diff options
author | Karl Berry <karl@freefriends.org> | 2013-10-16 00:24:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-10-16 00:24:15 +0000 |
commit | ab7092f5d2e7b43d4c18c8a7f003710d4aa868f1 (patch) | |
tree | 800c505bbacf470cf58c87de608b0ae5a97f6b9e /Master/tlpkg | |
parent | 555d7e60525622cad278ddd43e42d11d483a2d82 (diff) |
(run_cmd): don't return undef for $output.
git-svn-id: svn://tug.org/texlive/trunk@31914 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index f2aaf44c95e..aec7a73f35c 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -522,19 +522,21 @@ sub xsystem { =item C<run_cmd($cmd)> -runs a command and captures its output. Then returns a list with the -output as first element and the return value (exit code) as second. +runs shell CMD and captures its output. Returns a list with CMD's +output as the first element and the return value (exit code) as second. =cut sub run_cmd { my $cmd = shift; my $output = `$cmd`; + $output = "" if ! defined ($output); # don't return undef + my $retval = $?; if ($retval != 0) { $retval /= 256 if $retval > 0; } - return ($output, $retval); + return ($output,$retval); } |