diff options
author | Eric Andersen <andersen@codepoet.org> | 2004-10-08 08:27:40 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2004-10-08 08:27:40 +0000 |
commit | 751750e3ee0195eef802a1554e97712285bf8fd7 (patch) | |
tree | d9be042b9ba8bb035142138206b358723b0e7984 | |
parent | 82baf63de5eb905ab255b4eea31e283f89f4cbf4 (diff) | |
download | busybox-w32-751750e3ee0195eef802a1554e97712285bf8fd7.tar.gz busybox-w32-751750e3ee0195eef802a1554e97712285bf8fd7.tar.bz2 busybox-w32-751750e3ee0195eef802a1554e97712285bf8fd7.zip |
Patch from Denis Vlasenko to fix a problem where
wget http://1.2.3.4/abc/ loses last '/'
-rw-r--r-- | networking/wget.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/networking/wget.c b/networking/wget.c index e233daf05..45acef4d6 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -239,11 +239,15 @@ int wget_main(int argc, char **argv) | |||
239 | 239 | ||
240 | /* Guess an output filename */ | 240 | /* Guess an output filename */ |
241 | if (!fname_out) { | 241 | if (!fname_out) { |
242 | fname_out = | 242 | // Dirty hack. Needed because bb_get_last_path_component |
243 | // will destroy trailing / by storing '\0' in last byte! | ||
244 | if(target.path[strlen(target.path)-1]!='/') { | ||
245 | fname_out = | ||
243 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR | 246 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR |
244 | curfile = | 247 | curfile = |
245 | #endif | 248 | #endif |
246 | bb_get_last_path_component(target.path); | 249 | bb_get_last_path_component(target.path); |
250 | } | ||
247 | if (fname_out==NULL || strlen(fname_out)<1) { | 251 | if (fname_out==NULL || strlen(fname_out)<1) { |
248 | fname_out = | 252 | fname_out = |
249 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR | 253 | #ifdef CONFIG_FEATURE_WGET_STATUSBAR |
@@ -850,7 +854,7 @@ progressmeter(int flag) | |||
850 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 854 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
851 | * SUCH DAMAGE. | 855 | * SUCH DAMAGE. |
852 | * | 856 | * |
853 | * $Id: wget.c,v 1.74 2004/04/14 17:51:24 andersen Exp $ | 857 | * $Id: wget.c,v 1.75 2004/10/08 08:27:40 andersen Exp $ |
854 | */ | 858 | */ |
855 | 859 | ||
856 | 860 | ||