diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-08-14 21:28:00 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-08-14 21:28:00 +0000 |
commit | 06b3f49c49897558d5692b5f0480107b769be361 (patch) | |
tree | 09365d714d13e45a661cac3da49fd499eac1ee89 /window.c | |
parent | 1063e5d0e4abda89934b664a71737a32e278b4e3 (diff) | |
download | rtmux-06b3f49c49897558d5692b5f0480107b769be361.tar.gz rtmux-06b3f49c49897558d5692b5f0480107b769be361.tar.bz2 rtmux-06b3f49c49897558d5692b5f0480107b769be361.zip |
Sync OpenBSD patchset 249:
When started as the shell, __progname contains a leading -, so hardcode "tmux"
for socket path and log files, and strip it when working out the shell.
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.101 2009-08-14 21:23:20 tcunha Exp $ */ +/* $Id: window.c,v 1.102 2009-08-14 21:28:00 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -60,6 +60,7 @@ const char * window_default_command(void) { const char *shell, *ptr; + char *progname; struct passwd *pw; shell = getenv("SHELL"); @@ -79,7 +80,10 @@ found: ptr++; else ptr = shell; - if (strcmp(ptr, __progname) == 0) + progname = __progname; + if (*progname == '-') + progname++; + if (strcmp(ptr, progname) == 0) return (_PATH_BSHELL); return (shell); } |