mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
Skip fields in the manner required by POSIX, and the way V7 did it.
MFC after: 1 week
This commit is contained in:
parent
c1c9929e9f
commit
382ac430cd
1 changed files with 7 additions and 9 deletions
|
|
@ -208,16 +208,14 @@ char *
|
|||
skip(str)
|
||||
register char *str;
|
||||
{
|
||||
register int infield, nchars, nfields;
|
||||
register int nchars, nfields;
|
||||
|
||||
for (nfields = numfields, infield = 0; nfields && *str; ++str)
|
||||
if (isblank((unsigned char)*str)) {
|
||||
if (infield) {
|
||||
infield = 0;
|
||||
--nfields;
|
||||
}
|
||||
} else if (!infield)
|
||||
infield = 1;
|
||||
for (nfields = 0; *str != '\0' && nfields++ != numfields; ) {
|
||||
while (isblank((unsigned char)*str))
|
||||
str++;
|
||||
while (*str != '\0' && !isblank((unsigned char)*str))
|
||||
str++;
|
||||
}
|
||||
for (nchars = numchars; nchars-- && *str; ++str);
|
||||
return(str);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue