mirror of
https://github.com/curl/curl.git
synced 2026-04-15 00:41:41 +03:00
getpart: better handle case of file not found
This commit is contained in:
parent
88f1b70546
commit
07ab5bdd3b
1 changed files with 5 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue