From 20b25a51550f3361e3cdd0608b1801cb56f09bf2 Mon Sep 17 00:00:00 2001 From: sabetts Date: Thu, 13 Sep 2001 10:32:18 +0000 Subject: * src/actions.c (command): Gobble the whitespace between the command and the argument list. Code that did this in specific commands has been removed. * src/input.c (update_input_window): Draw a cheap-o cursor --- src/actions.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/actions.c') 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. */ -- cgit v1.2.3