|
|
@ -283,8 +283,7 @@ gettok(char **s) |
|
|
char *beg, *token ; /* return token */ |
|
|
char *beg, *token ; /* return token */ |
|
|
|
|
|
|
|
|
paren = 0; |
|
|
paren = 0; |
|
|
while (isspace_c(**s)) |
|
|
|
|
|
(*s)++; |
|
|
|
|
|
|
|
|
TEMPORARY_SKIP_WS_X1(*s); |
|
|
if (!**s) |
|
|
if (!**s) |
|
|
return (NULL); |
|
|
return (NULL); |
|
|
beg = *s ; |
|
|
beg = *s ; |
|
|
@ -358,8 +357,7 @@ gettok_noparens(char **s) |
|
|
char c; |
|
|
char c; |
|
|
char *beg, *token ; /* return token */ |
|
|
char *beg, *token ; /* return token */ |
|
|
|
|
|
|
|
|
while ( isspace_c(**s) ) |
|
|
|
|
|
(*s)++; /* iterate over whitespace */ |
|
|
|
|
|
|
|
|
TEMPORARY_SKIP_WS_X1(*s); |
|
|
|
|
|
|
|
|
if (!**s) |
|
|
if (!**s) |
|
|
return (NULL); /* return NULL if we come to end of line */ |
|
|
return (NULL); /* return NULL if we come to end of line */ |
|
|
@ -377,8 +375,7 @@ gettok_noparens(char **s) |
|
|
token = copy_substring(beg, *s) ; |
|
|
token = copy_substring(beg, *s) ; |
|
|
|
|
|
|
|
|
/* Now iterate up to next non-whitespace char */ |
|
|
/* Now iterate up to next non-whitespace char */ |
|
|
while ( isspace_c(**s) ) |
|
|
|
|
|
(*s)++; |
|
|
|
|
|
|
|
|
TEMPORARY_SKIP_WS_X1(*s); |
|
|
|
|
|
|
|
|
return ( token ) ; |
|
|
return ( token ) ; |
|
|
} |
|
|
} |
|
|
@ -389,8 +386,7 @@ gettok_instance(char **s) |
|
|
char c; |
|
|
char c; |
|
|
char *beg, *token ; /* return token */ |
|
|
char *beg, *token ; /* return token */ |
|
|
|
|
|
|
|
|
while ( isspace_c(**s) ) |
|
|
|
|
|
(*s)++; /* iterate over whitespace */ |
|
|
|
|
|
|
|
|
TEMPORARY_SKIP_WS_X1(*s); |
|
|
|
|
|
|
|
|
if (!**s) |
|
|
if (!**s) |
|
|
return (NULL); /* return NULL if we come to end of line */ |
|
|
return (NULL); /* return NULL if we come to end of line */ |
|
|
@ -407,8 +403,7 @@ gettok_instance(char **s) |
|
|
token = copy_substring(beg, *s) ; |
|
|
token = copy_substring(beg, *s) ; |
|
|
|
|
|
|
|
|
/* Now iterate up to next non-whitespace char */ |
|
|
/* Now iterate up to next non-whitespace char */ |
|
|
while ( isspace_c(**s) ) |
|
|
|
|
|
(*s)++; |
|
|
|
|
|
|
|
|
TEMPORARY_SKIP_WS_X1(*s); |
|
|
|
|
|
|
|
|
return ( token ) ; |
|
|
return ( token ) ; |
|
|
} |
|
|
} |
|
|
@ -425,8 +420,7 @@ gettok_char(char **s, char p, bool inc_p, bool nested) |
|
|
char c; |
|
|
char c; |
|
|
char *beg, *token ; /* return token */ |
|
|
char *beg, *token ; /* return token */ |
|
|
|
|
|
|
|
|
while ( isspace_c(**s) ) |
|
|
|
|
|
(*s)++; /* iterate over whitespace */ |
|
|
|
|
|
|
|
|
TEMPORARY_SKIP_WS_X1(*s); |
|
|
|
|
|
|
|
|
if (!**s) |
|
|
if (!**s) |
|
|
return (NULL); /* return NULL if we come to end of line */ |
|
|
return (NULL); /* return NULL if we come to end of line */ |
|
|
@ -473,8 +467,7 @@ gettok_char(char **s, char p, bool inc_p, bool nested) |
|
|
token = copy_substring(beg, *s) ; |
|
|
token = copy_substring(beg, *s) ; |
|
|
|
|
|
|
|
|
/* Now iterate up to next non-whitespace char */ |
|
|
/* Now iterate up to next non-whitespace char */ |
|
|
while ( isspace_c(**s) ) |
|
|
|
|
|
(*s)++; |
|
|
|
|
|
|
|
|
TEMPORARY_SKIP_WS_X1(*s); |
|
|
|
|
|
|
|
|
return ( token ) ; |
|
|
return ( token ) ; |
|
|
} |
|
|
} |
|
|
@ -671,7 +664,7 @@ get_comma_separated_values( char *values[], char *str ) { |
|
|
values[count++] = strdup(str); |
|
|
values[count++] = strdup(str); |
|
|
*ptr = keep; |
|
|
*ptr = keep; |
|
|
str = comma_ptr + 1; |
|
|
str = comma_ptr + 1; |
|
|
while ( isspace_c(*str) ) str++; |
|
|
|
|
|
|
|
|
TEMPORARY_SKIP_WS_X1(str); |
|
|
} |
|
|
} |
|
|
values[count++] = strdup(str); |
|
|
values[count++] = strdup(str); |
|
|
return count; |
|
|
return count; |
|
|
|