From ab7092f5d2e7b43d4c18c8a7f003710d4aa868f1 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 16 Oct 2013 00:24:15 +0000 Subject: (run_cmd): don't return undef for $output. git-svn-id: svn://tug.org/texlive/trunk@31914 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Master') 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 -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); } -- cgit v1.2.3