On 2009-08-24, Jan Stary <h...@stare.cz> wrote: >> >> About fixing it, I think ftp should just use the filename part >> of the URL from the command line and not adjust it when there's >> a redirect. I think allowing the remote server to change file >> name is downright dangerous; "Location: http://blah/.profile", >> anyone?). > > Maybe I missunderstand this, but should the file saved from > http://sourceforge.net/projects/snd/files/snd/10.8/snd-10.8.tar.gz/download > (which is the actual download link from http://sourceforge.net/projects/snd/) > be named 'download' then?
In the absence of any command-line instructions to the contrary, yes, I do think that should be the case. >> The diff below changes to this behaviour; I think this is what's >> actually described in the last paragraph of "AUTO-FETCHING FILES" >> in ftp(1) so I don't think the manual needs to be changed (but >> it probably does warrant a mention in current.html). >> >> Any comments/OKs? I have an OK but I'm going to leave it open for a little while for more comments. >> Index: fetch.c >> =================================================================== >> RCS file: /cvs/src/usr.bin/ftp/fetch.c,v >> retrieving revision 1.95 >> diff -u -p -r1.95 fetch.c >> --- fetch.c 6 Aug 2009 23:33:35 -0000 1.95 >> +++ fetch.c 22 Aug 2009 22:01:37 -0000 >> @@ -732,7 +732,7 @@ again: >> free(proxyurl); >> free(newline); >> free(cookie); >> - rval = url_get(cp, proxyenv, outfile); >> + rval = url_get(cp, proxyenv, savefile); >> free(buf); >> return (rval);