mirror of https://github.com/mirror/busybox.git
- use skip_non_whitespace() where appropriate
parent
8b1fab2879
commit
de17ece1db
|
@ -75,9 +75,7 @@ int uniq_main(int argc, char **argv)
|
||||||
e1 = s1;
|
e1 = s1;
|
||||||
for (i = skip_fields; i; i--) {
|
for (i = skip_fields; i; i--) {
|
||||||
e1 = skip_whitespace(e1);
|
e1 = skip_whitespace(e1);
|
||||||
while (*e1 && !isspace(*e1)) {
|
e1 = skip_non_whitespace(e1);
|
||||||
++e1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (i = skip_chars; *e1 && i; i--) {
|
for (i = skip_chars; *e1 && i; i--) {
|
||||||
++e1;
|
++e1;
|
||||||
|
|
|
@ -182,9 +182,7 @@ static char *get_token(char **buffer)
|
||||||
current = skip_whitespace(*buffer);
|
current = skip_whitespace(*buffer);
|
||||||
if (*current != 0) {
|
if (*current != 0) {
|
||||||
start = current;
|
start = current;
|
||||||
while (!isspace(*current) && *current != 0) {
|
current = skip_non_whitespace(current);
|
||||||
current++;
|
|
||||||
}
|
|
||||||
*buffer = current;
|
*buffer = current;
|
||||||
}
|
}
|
||||||
return start;
|
return start;
|
||||||
|
|
|
@ -90,7 +90,7 @@ static char *parse_word(char *start, struct command **cmd)
|
||||||
|
|
||||||
// Grab next word. (Add dequote and envvar logic here)
|
// Grab next word. (Add dequote and envvar logic here)
|
||||||
end = start;
|
end = start;
|
||||||
while (*end && !isspace(*end)) end++;
|
end = skip_non_whitespace(end);
|
||||||
(*cmd)->argv[(*cmd)->argc++] = xstrndup(start, end-start);
|
(*cmd)->argv[(*cmd)->argc++] = xstrndup(start, end-start);
|
||||||
|
|
||||||
// Allocate more space if there's no room for NULL terminator.
|
// Allocate more space if there's no room for NULL terminator.
|
||||||
|
|
Loading…
Reference in New Issue