diff options
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -497,20 +497,10 @@ client_send_identify(const char *ttynam, const char *termname, char **caps, static __dead void client_exec(const char *shell, const char *shellcmd) { - const char *name, *ptr; - char *argv0; + char *argv0; log_debug("shell %s, command %s", shell, shellcmd); - - ptr = strrchr(shell, '/'); - if (ptr != NULL && *(ptr + 1) != '\0') - name = ptr + 1; - else - name = shell; - if (client_flags & CLIENT_LOGIN) - xasprintf(&argv0, "-%s", name); - else - xasprintf(&argv0, "%s", name); + argv0 = shell_argv0(shell, !!(client_flags & CLIENT_LOGIN)); setenv("SHELL", shell, 1); proc_clear_signals(client_proc, 1); |