+2015-03-09 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ * posix/wordexp.c (CHAR_IN_SET): New macro.
+ (parse_param): Use it.
+
2015-03-09 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
* sysdeps/powerpc/fpu/libm-test-ulps: update.
return WRDE_SYNTAX;
}
+#define CHAR_IN_SET(ch, char_set) \
+ (memchr (char_set "", ch, sizeof (char_set) - 1) != NULL)
+
static int
internal_function
parse_param (char **word, size_t *word_length, size_t *max_length,
}
while (isdigit(words[++*offset]));
}
- else if (words[*offset] != '\0' && strchr ("*@$", words[*offset]) != NULL)
+ else if (CHAR_IN_SET (words[*offset], "*@$"))
{
/* Special parameter. */
special = 1;
break;
case ':':
- if (words[1 + *offset] == '\0'
- || strchr ("-=?+", words[1 + *offset]) == NULL)
+ if (!CHAR_IN_SET (words[1 + *offset], "-=?+"))
goto syntax;
colon_seen = 1;
return error;
}
+#undef CHAR_IN_SET
+
static int
internal_function
parse_dollars (char **word, size_t *word_length, size_t *max_length,