Print a better message than '(null)' if no command is specified ("tmux \;").

This commit is contained in:
Nicholas Marriott 2009-06-04 23:34:32 +00:00
parent 38b2c42f63
commit 85e0d8a221

4
cmd.c
View File

@ -108,8 +108,10 @@ cmd_parse(int argc, char **argv, char **cause)
int opt; int opt;
*cause = NULL; *cause = NULL;
if (argc == 0) if (argc == 0) {
xasprintf(cause, "no command");
return (NULL); return (NULL);
}
entry = NULL; entry = NULL;
for (entryp = cmd_table; *entryp != NULL; entryp++) { for (entryp = cmd_table; *entryp != NULL; entryp++) {