X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=libbb%2Fskip_whitespace.c;h=bdfb97d70258a91ec7acd8f992ec9fbf1641e006;hb=516a0ca2dc92d9ea103535863102cc5425fe648e;hp=02c1f5828897a42c6def21c97d054a26cabb3a0e;hpb=ea224be6aa8fed5486376d3021a4cb911e935106;p=oweals%2Fbusybox.git diff --git a/libbb/skip_whitespace.c b/libbb/skip_whitespace.c index 02c1f5828..bdfb97d70 100644 --- a/libbb/skip_whitespace.c +++ b/libbb/skip_whitespace.c @@ -7,12 +7,19 @@ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ -#include #include "libbb.h" char *skip_whitespace(const char *s) { + /* NB: isspace('0') returns 0 */ while (isspace(*s)) ++s; return (char *) s; } + +char *skip_non_whitespace(const char *s) +{ + while (*s && !isspace(*s)) ++s; + + return (char *) s; +}