From fe60afd4b7b7d4ee6bd271d5aee2d2ff088b563c Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 29 Aug 2019 12:47:52 -0700 Subject: ls: fix recent regression. Commit c26870dab3462c6176936384b090df6b9ba46dee broke ls' error reporting for files that don't exist. `ls $F` is used by some as an equivalent of `test -e $F`. This patch also adds a regression test. --- tests/ls.test | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/ls.test b/tests/ls.test index 56f74034..6c8e0efe 100755 --- a/tests/ls.test +++ b/tests/ls.test @@ -50,5 +50,8 @@ rm -rf lstest/* && touch lstest/file1.txt && INODE=`stat -c %i lstest/file1.txt` testing "with -i" "$IN && ls -i 2>/dev/null; $OUT" "$INODE file1.txt\n" "" "" unset INODE +testing "missing" "$IN && ls does-not-exist 2>err ; grep -q 'ls:.*missing.*: No +such file' err || echo missing error; $OUT" "" "" "" + # Removing test dir for cleanup purpose rm -rf lstest -- cgit v1.2.3