dafs state analyzer shouldn't require trailing spaces in commands
authorDerrick Brashear <shadow@dementia.org>
Fri, 11 Jun 2010 19:06:24 +0000 (15:06 -0400)
committerDerrick Brashear <shadow@dementia.org>
Fri, 11 Jun 2010 19:16:20 +0000 (12:16 -0700)
the tokenizer didn't null out \n, but the strcmps for commands didn't deal,
so this basically works badly interactively. all commands not recognized.

Change-Id: Ifa7f8c0204a83d27f8876af8de94cb338499cdc0
Reviewed-on: http://gerrit.openafs.org/2125
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/tviced/state_analyzer.c

index d3bfd38..11928d8 100644 (file)
@@ -381,10 +381,10 @@ prompt(void)
                strlcpy(prev_input, input, sizeof(prev_input));
            }
 
-           tok = strtok(input, " \t");
+           tok = strtok(input, " \t\n");
        }
        while (tok && !strcmp(tok, ";")) {
-           tok = strtok(NULL, "; \t");
+           tok = strtok(NULL, "; \t\n");
        }
 
        if (!tok) {