mirror of
https://github.com/mirror/wget.git
synced 2025-03-04 14:50:35 +08:00
* src/url.c (url_file_name): Do not charset convert local directory
In a non-ASCII environment, the local path may contain non-ASCII characters. The server responded file name must be converted before it is concatenated to the local path. Conversion after concatenation may result in 'iconv' errors.
This commit is contained in:
parent
2215ee8d10
commit
cf5df5593d
@ -1732,6 +1732,9 @@ url_file_name (const struct url *u, char *replaced_filename)
|
||||
fname_len_check = concat_strings (u_file, FN_QUERY_SEP_STR, u->query, NULL);
|
||||
else
|
||||
fname_len_check = strdupdelim (u_file, u_file + strlen (u_file));
|
||||
|
||||
/* convert before concat with local path */
|
||||
fname_len_check = convert_fname (fname_len_check);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1793,8 +1796,6 @@ url_file_name (const struct url *u, char *replaced_filename)
|
||||
|
||||
xfree (temp_fnres.base);
|
||||
|
||||
fname = convert_fname (fname);
|
||||
|
||||
/* Check the cases in which the unique extensions are not used:
|
||||
1) Clobbering is turned off (-nc).
|
||||
2) Retrieval with regetting.
|
||||
|
Loading…
Reference in New Issue
Block a user