summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/client.c b/client.c
index 9cd5ad85..4bec9f1d 100644
--- a/client.c
+++ b/client.c
@@ -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);