summaryrefslogtreecommitdiffstats
path: root/tmux.c
diff options
context:
space:
mode:
authornicm <nicm>2017-07-12 09:21:25 +0000
committernicm <nicm>2017-07-12 09:21:25 +0000
commited3cfaafb2c04776b6452fa968715a3626d99a4a (patch)
tree9965a5cdf8b88c001b4aa63821776662adda9e9b /tmux.c
parentd0d42dc4cbe3fd3969662cb9e36766050af08f03 (diff)
Make shell_command a global like other stuff rather than making it an
exception and using callback argument.
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 07aeeaeb..b8a73fd9 100644
--- a/tmux.c
+++ b/tmux.c
@@ -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));
}