When we try to download a redirected url similar to
http://www.netmester.dk/forside.asp?page=dept&objno=509
wget tries to store that in a filename same as the
url(forside.asp?page=dept&objno=509).
Some of these characters are illegal(in windows " \ [ ] : ; = ? , are
illegal) in a filename so wget exits with a message
Cannot write to forside.asp?page=dept&objno=509 INVALID arg.The
following patch tries to rectify this in
url_filename() in url.cThis works for me .Hope it does not break
anything
Index: src/url.c
===================================================================
diff -u -r url.c
@@ -1237,21 +1237,21 @@
/* DOS-ish file systems don't like `%' signs in them; we change it
to `@'. */
#ifdef WINDOWS
{
char *p = file;
for (p = file; *p; p++)
- if ((*p == '%') ||
+ if ((*p == '%') ||
+ (*p == ' " ') ||
+ (*p == '\\') ||
+ (*p == '[') ||
+ (*p == ']') ||
+ (*p == ':') ||
+ (*p == ';') ||
+ (*p == '=') ||
+ (*p == '?') ||
+ (*p == ','))
*p = '@';
}
#endif /* WINDOWS */
Regards
Bharath