/* always check for a literal (may be "") between patterns */
if(GLOB_ERROR == glob_word(glob, ++pattern, ++pos, &wordamount))
- wordamount=1;
+ return GLOB_ERROR;
*amount = pat->content.Set.size * wordamount;
done = TRUE;
*amount = 1; /* default is one single string */
while (*pattern != '\0' && *pattern != '{' && *pattern != '[') {
- if (*pattern == '}' || *pattern == ']')
+ if (*pattern == '}' || *pattern == ']') {
+ snprintf(glob->errormsg, sizeof(glob->errormsg),
+ "unmatched close brace/bracket at pos %zu\n", pos);
return GLOB_ERROR;
+ }
/* only allow \ to escape known "special letters" */
if (*pattern == '\\' &&
else {
if(error && glob_expand->errormsg[0]) {
/* send error description to the error-stream */
- fprintf(error, "curl: (%d) [globbing] %s\n",
+ fprintf(error, "curl: (%d) [globbing] %s",
CURLE_URL_MALFORMAT, glob_expand->errormsg);
}
/* it failed, we cleanup */