simple env variable cleanup (treating empty environment variables as unset)
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Tue, 12 Oct 2010 07:44:43 +0000 (03:44 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Tue, 12 Oct 2010 07:44:43 +0000 (03:44 -0400)
Crypt/Monkeysphere/MSVA.pm

index 8ae6b9b583e2d97a6c9f8b65911cf832633bdcbc..72c7167b770829600a94ccf4b7b12404f3342fc8 100755 (executable)
     my $class = shift;
 
     my $port = 0;
-    if (exists $ENV{MSVA_PORT}) {
+    if (exists $ENV{MSVA_PORT} and $ENV{MSVA_PORT} ne '') {
+      msvalog('debug', "MSVA_PORT set to %s\n", $ENV{MSVA_PORT});
       $port = $ENV{MSVA_PORT} + 0;
       die sprintf("not a reasonable port %d", $port) if (($port >= 65536) || $port <= 0);
     }