diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-08-24 08:31:36 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-08-24 22:41:37 +0200 |
commit | 5620d2cc78c018f6ae15ba9aab371aa388146df0 (patch) | |
tree | 897b7e75250a644e5aeae81de5daf3498602286b /tests/runtests.pl | |
parent | 510d98157f21dee5793c4e975fde3317b6139267 (diff) | |
download | curl-5620d2cc78c018f6ae15ba9aab371aa388146df0.tar.gz |
curl: add --output-dir
Works with --create-dirs and with -J
Add test 3008, 3009, 3011, 3012 and 3013 to verify.
Closes #5637
Diffstat (limited to 'tests/runtests.pl')
-rwxr-xr-x | tests/runtests.pl | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl index b0bddba1c..3985f7fde 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -2713,15 +2713,21 @@ sub cleardir { my $file; # Get all files - opendir(DIR, $dir) || + opendir(my $dh, $dir) || return 0; # can't open dir - while($file = readdir(DIR)) { - if(($file !~ /^\.(|\.)$/)) { - unlink("$dir/$file"); + while($file = readdir($dh)) { + if(($file !~ /^(\.|\.\.)\z/)) { + if(-d "$dir/$file") { + cleardir("$dir/$file"); + rmdir("$dir/$file"); + } + else { + unlink("$dir/$file"); + } $count++; } } - closedir DIR; + closedir $dh; return $count; } |