summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/actions.c b/src/actions.c
index 91efce0..e3101a6 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -778,6 +778,16 @@ command (int interactive, char *data)
rest = strtok (NULL, "\0");
+ /* Gobble whitespace */
+ if (rest)
+ {
+ while (*rest == ' ')
+ rest++;
+ /* If rest is empty, then we have no argument. */
+ if (*rest == '\0')
+ rest = NULL;
+ }
+
PRINT_DEBUG ("cmd==%s rest==%s\n", cmd, (char*)rest);
/* find the command */
@@ -1666,10 +1676,7 @@ cmd_defwinname (int interactive, void *data)
return NULL;
}
- /* Gobble whitespace */
name = (char *)data;
- while (*name == ' ')
- name++;
/* FIXME: Using strncmp is sorta dirty since `title' and
`titlefoobar' would both match. But its quick and dirty. */