summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-09-11 22:03:47 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-09-11 22:03:47 +0200
commitd7b088caeb6b596ab8a6d9e42b14507faf1cb928 (patch)
tree6232e1671413503acd72796755bc3f874b01a6dc
parent11e8a43f853b9bf050db58f073e6f2411821ce60 (diff)
downloadcurl-d7b088caeb6b596ab8a6d9e42b14507faf1cb928.tar.gz
urlblob: improve error message
to help user understand what the problem is Fixes #2763
-rw-r--r--src/tool_urlglob.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c
index cb87706cc..e4a5c33db 100644
--- a/src/tool_urlglob.c
+++ b/src/tool_urlglob.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -459,18 +459,19 @@ CURLcode glob_url(URLGlob **glob, char *url, unsigned long *urlnum,
*urlnum = amount;
else {
if(error && glob_expand->error) {
- char text[128];
+ char text[512];
const char *t;
if(glob_expand->pos) {
- snprintf(text, sizeof(text), "%s in column %zu", glob_expand->error,
- glob_expand->pos);
+ snprintf(text, sizeof(text), "%s in URL position %zu:\n%s\n%*s^",
+ glob_expand->error,
+ glob_expand->pos, url, glob_expand->pos - 1, " ");
t = text;
}
else
t = glob_expand->error;
/* send error description to the error-stream */
- fprintf(error, "curl: (%d) [globbing] %s\n", res, t);
+ fprintf(error, "curl: (%d) %s\n", res, t);
}
/* it failed, we cleanup */
glob_cleanup(glob_expand);