summaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 15:56:39 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 15:56:39 +0000
commitb9155e835a56b4301fc22c4aa7e05457e13144d8 (patch)
treee5002dc1d25350f94a391b40a804d7cfdeb375a1 /cmd.c
parentf90450f854bb868e8f6f0dad5c59c0eedb05e933 (diff)
Print a better message than '(null)' if no command is specified ("tmux \;").
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd.c b/cmd.c
index 2f762188..e652abd4 100644
--- a/cmd.c
+++ b/cmd.c
@@ -1,4 +1,4 @@
-/* $Id: cmd.c,v 1.95 2009-05-16 11:48:47 nicm Exp $ */
+/* $OpenBSD: cmd.c,v 1.2 2009/06/04 23:34:32 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -108,8 +108,10 @@ cmd_parse(int argc, char **argv, char **cause)
int opt;
*cause = NULL;
- if (argc == 0)
+ if (argc == 0) {
+ xasprintf(cause, "no command");
return (NULL);
+ }
entry = NULL;
for (entryp = cmd_table; *entryp != NULL; entryp++) {