From df18c9e895e75e77ed466dea3b06ef2a0a07260a Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 11 Jun 2010 16:51:02 -0500 Subject: [PATCH] vlclient: work with non-space whitespace Make vlclient work with non-space whitespace separating arguments. This also makes it cope with a trailing newline that fgets() gives us, making this more intuitive to use. Change-Id: Ida4da9f997ac073a5afa6c95e1b3cec180c18e1a Reviewed-on: http://gerrit.openafs.org/2126 Tested-by: Andrew Deason Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear --- src/vlserver/vlclient.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vlserver/vlclient.c b/src/vlserver/vlclient.c index 3038cc0cb..ef7081871 100644 --- a/src/vlserver/vlclient.c +++ b/src/vlserver/vlclient.c @@ -37,6 +37,7 @@ #endif #include #include +#include #include #include @@ -1316,14 +1317,14 @@ GetArgs(char *line, char **args, int *nargs) *nargs = 0; while (*line) { register char *last = line; - while (*line == ' ') + while (isspace(*line)) line++; - if (*last == ' ') + if (isspace(*last)) *last = 0; if (!*line) break; *args++ = line, (*nargs)++; - while (*line && *line != ' ') + while (*line && !isspace(*line)) line++; } } -- 2.39.5