summaryrefslogtreecommitdiffstats
path: root/tmux.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-07-12 13:39:59 +0100
committerThomas Adam <thomas@xteddy.org>2017-07-12 13:43:08 +0100
commit1076a2e26c224d17c32a2d1770997d8718903f20 (patch)
tree2a51f6e719b9cbff0e37d7a887e56992ffb875bd /tmux.c
parentfbbf5a108b01c742ca11e779845a4d19a1c5edd1 (diff)
parent51112221eeb31ced907f0dfcf077582996c20c07 (diff)
Merge branch 'obsd-master'
Conflicts: cmd-pipe-pane.c proc.c tmux.c window.c
Diffstat (limited to 'tmux.c')
-rw-r--r--tmux.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tmux.c b/tmux.c
index f4a2d7f1..78cb499b 100644
--- a/tmux.c
+++ b/tmux.c
@@ -41,6 +41,7 @@ struct hooks *global_hooks;
struct timeval start_time;
const char *socket_path;
int ptm_fd = -1;
+const char *shell_command;
static __dead void usage(void);
static char *make_label(const char *);
@@ -187,8 +188,8 @@ find_home(void)
int
main(int argc, char **argv)
{
- char *path, *label, tmp[PATH_MAX];
- char *shellcmd = NULL, **var;
+ char *path, *label, **var;
+ char tmp[PATH_MAX];
const char *s, *shell;
int opt, flags, keys;
const struct options_table_entry *oe;
@@ -217,8 +218,7 @@ main(int argc, char **argv)
flags |= CLIENT_256COLOURS;
break;
case 'c':
- free(shellcmd);
- shellcmd = xstrdup(optarg);
+ shell_command = optarg;
break;
case 'C':
if (flags & CLIENT_CONTROL)
@@ -258,7 +258,7 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
- if (shellcmd != NULL && argc != 0)
+ if (shell_command != NULL && argc != 0)
usage();
if ((ptm_fd = getptmfd()) == -1)
@@ -348,5 +348,5 @@ main(int argc, char **argv)
free(label);
/* Pass control to the client. */
- exit(client_main(osdep_event_init(), argc, argv, flags, shellcmd));
+ exit(client_main(osdep_event_init(), argc, argv, flags));
}