src/exec: fix assertion on failed exec redirection

Minimal reproducer: `fish -c "exec cat<x"`
This commit is contained in:
Mrmaxmeier
2019-02-11 17:10:42 +01:00
committed by ridiculousfish
parent b247c8d9ad
commit 6e9250425a
5 changed files with 18 additions and 1 deletions

4
tests/test_exec_fail.err Normal file
View File

@@ -0,0 +1,4 @@
<W> fish: An error occurred while redirecting file 'nosuchfile'
open: No such file or directory
<W> fish: An error occurred while redirecting file 'nosuchfile'
open: No such file or directory

6
tests/test_exec_fail.in Normal file
View File

@@ -0,0 +1,6 @@
exec cat < nosuchfile
echo "failed: $status"
not exec cat < nosuchfile
echo "neg failed: $status"
exec cat < /dev/null
echo "not reached"

2
tests/test_exec_fail.out Normal file
View File

@@ -0,0 +1,2 @@
failed: 1
neg failed: 0

View File

@@ -0,0 +1 @@
0