From bad743aed5a8fd22742317c344f126f04a0392ca Mon Sep 17 00:00:00 2001 From: Philip Sequeira Date: Sat, 19 Sep 2015 19:26:22 -0400 Subject: TOOLS/zsh.pl: only check the actual exit code when calling mpv Ignore the other bits of $?. Apparently they can be set even if the command succeeded. --- TOOLS/zsh.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'TOOLS/zsh.pl') diff --git a/TOOLS/zsh.pl b/TOOLS/zsh.pl index 91b15bbde5..309c0d4b22 100755 --- a/TOOLS/zsh.pl +++ b/TOOLS/zsh.pl @@ -232,8 +232,8 @@ sub call_mpv { my $output = `"$mpv" --no-config $cmd`; if ($? == -1) { die "Could not run mpv: $!"; - } elsif ($? != 0) { - die "mpv returned " . ($? >> 8) . " with output:\n$output"; + } elsif ((my $exit_code = $? >> 8) != 0) { + die "mpv returned $exit_code with output:\n$output"; } return split /\n/, $output; } -- cgit v1.2.3