skip-ws, #3/6, use TEMPORARY macros, obj-invariant

This commit is contained in:
rlar
2016-03-22 15:26:06 +01:00
parent 6d1171ad6f
commit a86f2068c8
14 changed files with 46 additions and 91 deletions
+8 -15
View File
@@ -283,8 +283,7 @@ gettok(char **s)
char *beg, *token ; /* return token */
paren = 0;
while (isspace_c(**s))
(*s)++;
TEMPORARY_SKIP_WS_X1(*s);
if (!**s)
return (NULL);
beg = *s ;
@@ -358,8 +357,7 @@ gettok_noparens(char **s)
char c;
char *beg, *token ; /* return token */
while ( isspace_c(**s) )
(*s)++; /* iterate over whitespace */
TEMPORARY_SKIP_WS_X1(*s);
if (!**s)
return (NULL); /* return NULL if we come to end of line */
@@ -377,8 +375,7 @@ gettok_noparens(char **s)
token = copy_substring(beg, *s) ;
/* Now iterate up to next non-whitespace char */
while ( isspace_c(**s) )
(*s)++;
TEMPORARY_SKIP_WS_X1(*s);
return ( token ) ;
}
@@ -389,8 +386,7 @@ gettok_instance(char **s)
char c;
char *beg, *token ; /* return token */
while ( isspace_c(**s) )
(*s)++; /* iterate over whitespace */
TEMPORARY_SKIP_WS_X1(*s);
if (!**s)
return (NULL); /* return NULL if we come to end of line */
@@ -407,8 +403,7 @@ gettok_instance(char **s)
token = copy_substring(beg, *s) ;
/* Now iterate up to next non-whitespace char */
while ( isspace_c(**s) )
(*s)++;
TEMPORARY_SKIP_WS_X1(*s);
return ( token ) ;
}
@@ -425,8 +420,7 @@ gettok_char(char **s, char p, bool inc_p, bool nested)
char c;
char *beg, *token ; /* return token */
while ( isspace_c(**s) )
(*s)++; /* iterate over whitespace */
TEMPORARY_SKIP_WS_X1(*s);
if (!**s)
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) ;
/* Now iterate up to next non-whitespace char */
while ( isspace_c(**s) )
(*s)++;
TEMPORARY_SKIP_WS_X1(*s);
return ( token ) ;
}
@@ -671,7 +664,7 @@ get_comma_separated_values( char *values[], char *str ) {
values[count++] = strdup(str);
*ptr = keep;
str = comma_ptr + 1;
while ( isspace_c(*str) ) str++;
TEMPORARY_SKIP_WS_X1(str);
}
values[count++] = strdup(str);
return count;