]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
target_fetchurl: Handle undefined $c{HttpProxy}
authorIan Campbell <ian.campbell@citrix.com>
Mon, 30 Nov 2015 11:48:31 +0000 (11:48 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 30 Nov 2015 14:16:39 +0000 (14:16 +0000)
Avoiding a usage of a potentially undefined variable.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/TestSupport.pm

index 61e885ab6bb093cef800456f05f41c7b9f77109b..a43feec9613e6caee405e9ad6242e9eeb6568b03 100644 (file)
@@ -1823,7 +1823,7 @@ END
 sub target_fetchurl($$$;$) {
     my ($ho, $url, $path, $timeo) = @_;
     $timeo ||= 2000;
-    my $useproxy = "export http_proxy=$c{HttpProxy};" if $c{HttpProxy};
+    my $useproxy = $c{HttpProxy} ? "export http_proxy=$c{HttpProxy};" : "";
     target_cmd_root($ho, <<END, $timeo);
     $useproxy wget --progress=dot:mega -O \Q$path\E \Q$url\E
 END