Skip to contentSkip to conversation

target_fetchurl: Handle undefined $c{HttpProxy}

PATCH In review Ian Campbell 2 participants 2 messages Nov 30, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target_fetchurl: Handle undefined $c{HttpProxy}

Avoiding a usage of a potentially undefined variable.

---
 Osstest/TestSupport.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Osstest/TestSupport.pm +1 -1
index 18b03b4..28ac572 100644
@@ -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
Signature · 1 line
2.6.1
Acked-by on v1 1/1
#1 lore raw

Ian Campbell writes ("[PATCH OSSTEST] target_fetchurl: Handle undefined $c{HttpProxy}"):

Quoted 1 line

Avoiding a usage of a potentially undefined variable.