]>
Commit | Line | Data |
---|---|---|
4d261d74 | 1 | --- bin/lwp-download 2004-11-14 07:36:25.000000000 +0100 |
2 | +++ bin/lwp-download 2004-12-10 21:12:41.136510344 +0100 | |
3 | @@ -91,7 +91,13 @@ | |
4 | sub { | |
5 | unless($file) { | |
6 | my $res = $_[1]; | |
7 | - unless ($argfile) { | |
8 | + | |
9 | + my $directory; | |
10 | + if (defined $argfile && -d $argfile) { | |
11 | + ($directory, $argfile) = ($argfile, undef); | |
12 | + } | |
13 | + | |
14 | + unless (defined $argfile && length $argfile) { | |
15 | # must find a suitable name to use. First thing | |
16 | # to do is to look for the "Content-Disposition" | |
17 | # header defined by RFC1806. This is also supported | |
18 | @@ -130,6 +136,11 @@ | |
19 | } | |
20 | } | |
21 | ||
22 | + if (defined $directory) { | |
23 | + require File::Spec; | |
24 | + $file = File::Spec->catfile($directory, $file); | |
25 | + } | |
26 | + | |
27 | # Check if the file is already present | |
28 | if (-f $file && -t) { | |
29 | $shown = 1; | |
30 | @@ -292,3 +303,5 @@ | |
31 | { | |
32 | die "Usage: $progname [-a] <url> [<lpath>]\n"; | |
33 | } | |
34 | + | |
35 | +# vi: ts=8 sw=4 |