typedef enum {
GLOB_OK,
- GLOB_NO_MEM,
- GLOB_ERROR
+ GLOB_NO_MEM = CURLE_OUT_OF_MEMORY,
+ GLOB_ERROR = CURLE_URL_MALFORMAT
} GlobCode;
void glob_cleanup(URLGlob* glob);
else {
if(error && glob_expand->errormsg[0]) {
/* send error description to the error-stream */
- fprintf(error, "curl: (%d) [globbing] %s",
- (res == GLOB_NO_MEM) ? CURLE_OUT_OF_MEMORY : CURLE_URL_MALFORMAT,
- glob_expand->errormsg);
+ fprintf(error, "curl: (%d) [globbing] %s", res, glob_expand->errormsg);
}
/* it failed, we cleanup */
glob_cleanup(glob_expand);
*urlnum = 1;
- return (res == GLOB_NO_MEM) ? CURLE_OUT_OF_MEMORY : CURLE_URL_MALFORMAT;
+ return res;
}
*glob = glob_expand;