From 2fd8d1a2595ee49f01d2987b125b642b7f50ea65 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Thu, 4 Feb 2016 10:49:52 -0800 Subject: Fix segfault when `find -iname` gets no argument. --- tests/find.test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/find.test') diff --git a/tests/find.test b/tests/find.test index 4e987b60..710684ec 100755 --- a/tests/find.test +++ b/tests/find.test @@ -74,4 +74,20 @@ testing "find unterminated -exec {}" \ testing "find -exec {} +" \ "find dir -type f -exec ls {} +" "dir/file\n" "" "" +# `find . -iname` was segfaulting +testing "find -name file" \ + "find dir -name file" "dir/file\n" "" "" +testing "find -name FILE" \ + "find dir -name FILE" "" "" "" + +testing "find -iname file" \ + "find dir -iname FILE" "dir/file\n" "" "" +testing "find -iname FILE" \ + "find dir -iname FILE" "dir/file\n" "" "" + + +testing "find -name (no arguments)" \ + "find dir -name 2>&1" "find: '-name' needs 1 arg\n" "" "" +testing "find -iname (no arguments)" \ + "find dir -iname 2>&1" "find: '-iname' needs 1 arg\n" "" "" rm -rf dir -- cgit v1.2.3