diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-04-10 09:38:35 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-04-10 09:38:35 +0000 |
commit | de17ece1dbbb3a5399e82fb5b820bb44997f8ca4 (patch) | |
tree | bf440665c9a99743cc22195351b0eec490ab8204 | |
parent | 8b1fab2879d57b044342ee3fece0825d4d3a509a (diff) | |
download | busybox-de17ece1dbbb3a5399e82fb5b820bb44997f8ca4.tar.gz |
- use skip_non_whitespace() where appropriate
-rw-r--r-- | coreutils/uniq.c | 4 | ||||
-rw-r--r-- | miscutils/dc.c | 4 | ||||
-rw-r--r-- | shell/bbsh.c | 2 |
3 files changed, 3 insertions, 7 deletions
diff --git a/coreutils/uniq.c b/coreutils/uniq.c index bcdf44026..11a731aaa 100644 --- a/coreutils/uniq.c +++ b/coreutils/uniq.c @@ -75,9 +75,7 @@ int uniq_main(int argc, char **argv) e1 = s1; for (i = skip_fields; i; i--) { e1 = skip_whitespace(e1); - while (*e1 && !isspace(*e1)) { - ++e1; - } + e1 = skip_non_whitespace(e1); } for (i = skip_chars; *e1 && i; i--) { ++e1; diff --git a/miscutils/dc.c b/miscutils/dc.c index 8c9d77fc3..1953a9489 100644 --- a/miscutils/dc.c +++ b/miscutils/dc.c @@ -182,9 +182,7 @@ static char *get_token(char **buffer) current = skip_whitespace(*buffer); if (*current != 0) { start = current; - while (!isspace(*current) && *current != 0) { - current++; - } + current = skip_non_whitespace(current); *buffer = current; } return start; diff --git a/shell/bbsh.c b/shell/bbsh.c index 4f38213c9..06fd0131e 100644 --- a/shell/bbsh.c +++ b/shell/bbsh.c @@ -90,7 +90,7 @@ static char *parse_word(char *start, struct command **cmd) // Grab next word. (Add dequote and envvar logic here) end = start; - while (*end && !isspace(*end)) end++; + end = skip_non_whitespace(end); (*cmd)->argv[(*cmd)->argc++] = xstrndup(start, end-start); // Allocate more space if there's no room for NULL terminator. |