mirror of
https://github.com/curl/curl.git
synced 2026-07-27 05:37:41 +03:00
tool_urlglob: better 'Duplicate glob name' position
This now points to where the duplicate name ends, not where it starts. Also fixes test 2410 to use a fixed hostname so that the error position remains the same. Reported-by: Viktor Szakats Fixes #21567 Closes #21568
This commit is contained in:
parent
02dca1eb86
commit
287b082c63
2 changed files with 5 additions and 8 deletions
|
|
@ -524,7 +524,7 @@ static CURLcode glob_parse(struct URLGlob *glob, const char *pattern,
|
|||
/* check that the name is not already used */
|
||||
struct URLPattern *p = glob_find_name(glob, &name);
|
||||
if(p)
|
||||
return globerror(glob, "Duplicate glob name", 2 + start - ipattern,
|
||||
return globerror(glob, "Duplicate glob name", pattern - ipattern,
|
||||
CURLE_URL_MALFORMAT);
|
||||
pos += (pattern - start);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,23 +12,20 @@ globbing
|
|||
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
http
|
||||
</server>
|
||||
<name>
|
||||
duplicate named glob
|
||||
</name>
|
||||
<command option="no-output">
|
||||
"%HOSTIP:%HTTPPORT/{%LTtest%GTA,B}{%LTtest%GTC,D}" -o "%LOGDIR/dump"
|
||||
"https://dummy.example/{%LTtest%GTA,B}{%LTtest%GTC,D}" -o "%LOGDIR/dump"
|
||||
</command>
|
||||
</client>
|
||||
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<stderr mode="text">
|
||||
curl: (3) Duplicate glob name in position 30:
|
||||
%HOSTIP:%HTTPPORT/{%LTtest%GTA,B}{%LTtest%GTC,D}
|
||||
^
|
||||
curl: (3) Duplicate glob name in position 40:
|
||||
https://dummy.example/{%LTtest%GTA,B}{%LTtest%GTC,D}
|
||||
^
|
||||
</stderr>
|
||||
<errorcode>
|
||||
3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue