aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-09-06 14:20:03 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-09-06 14:20:48 +0200
commitd6cda9e8ababe633f4b0b58776b1a9c4534e8095 (patch)
tree7aa1d854ebb6e2346f274d291760ea0bbdccd3dd /src
parent2a7f1425d98919b362fbe979a6428fa9aeebcd78 (diff)
urlglob: avoid error code translation
By using the correct values from the start we don't have to translate them!
Diffstat (limited to 'src')
-rw-r--r--src/tool_urlglob.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c
index 7c7bd4b35..647bbc569 100644
--- a/src/tool_urlglob.c
+++ b/src/tool_urlglob.c
@@ -31,8 +31,8 @@
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);
@@ -423,14 +423,12 @@ int glob_url(URLGlob** glob, char* url, unsigned long *urlnum, FILE *error)
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;