mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
getpart: better handle case of file not found
This commit is contained in:
parent
88f1b70546
commit
07ab5bdd3b
@ -325,11 +325,12 @@ sub loadarray {
|
||||
my ($filename)=@_;
|
||||
my @array;
|
||||
|
||||
open(my $temp, "<", "$filename");
|
||||
while(<$temp>) {
|
||||
push @array, $_;
|
||||
if (open(my $temp, "<", "$filename")) {
|
||||
while(<$temp>) {
|
||||
push @array, $_;
|
||||
}
|
||||
close($temp);
|
||||
}
|
||||
close($temp);
|
||||
return @array;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user