summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tmux.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-07-12 09:21:26 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-07-12 09:21:26 +0000
commitc9b01ab256541fdc54b723b8163431cc71fa516d (patch)
tree3dbd5c6bcacf917876ba43bdf624090fa20125ab /usr.bin/tmux/tmux.c
parent7ad3d185b56ec02a7535c2d22b50e9b62650bb87 (diff)
Make shell_command a global like other stuff rather than making it an
exception and using callback argument.
Diffstat (limited to 'usr.bin/tmux/tmux.c')
-rw-r--r--usr.bin/tmux/tmux.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c
index 8c68c31421c..c3a01d0aa53 100644
--- a/usr.bin/tmux/tmux.c
+++ b/usr.bin/tmux/tmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.c,v 1.183 2017/07/03 08:08:30 nicm Exp $ */
+/* $OpenBSD: tmux.c,v 1.184 2017/07/12 09:21:25 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -44,6 +44,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 *);
@@ -190,8 +191,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;
@@ -220,8 +221,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(event_init(), argc, argv, flags, shellcmd));
+ exit(client_main(event_init(), argc, argv, flags));
}