Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167368544
D10607.id28048.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D10607.id28048.diff
View Options
Index: contrib/netbsd-tests/usr.bin/grep/t_grep.sh
===================================================================
--- contrib/netbsd-tests/usr.bin/grep/t_grep.sh
+++ contrib/netbsd-tests/usr.bin/grep/t_grep.sh
@@ -494,6 +494,25 @@
atf_check -s exit:1 grep -v -w "x" test1
atf_check -s exit:1 grep -v -w "x" test2
}
+
+atf_test_case grep_lflag_nolines
+grep_lflag_nolines_head()
+{
+ atf_set "descr" "Check for -l flag not producing line matches or context (PR 219077)"
+}
+
+grep_lflag_nolines_body()
+{
+ printf "A\nB\nC\n" > test1
+
+ atf_check -o inline:"test1\n" grep -l -e "B" test1
+
+ atf_check -o inline:"test1\n" grep -l -B 1 -e "B" test1
+
+ atf_check -o inline:"test1\n" grep -l -A 1 -e "B" test1
+
+ atf_check -o inline:"test1\n" grep -l -C 1 -e "B" test1
+}
# End FreeBSD
atf_init_test_cases()
@@ -527,5 +546,6 @@
atf_add_test_case fgrep_sanity
atf_add_test_case egrep_sanity
atf_add_test_case grep_sanity
+ atf_add_test_case grep_lflag_nolines
# End FreeBSD
}
Index: usr.bin/grep/util.c
===================================================================
--- usr.bin/grep/util.c
+++ usr.bin/grep/util.c
@@ -283,7 +283,7 @@
tail = Aflag;
}
/* Print the matching line, but only if not quiet/binary */
- if (t == 0 && !qflag && !pc.binary) {
+ if (t == 0 && !lflag && !qflag && !pc.binary) {
printline(&pc, ':');
first_match = false;
same_file = true;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Aug 22, 9:58 AM (3 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37070654
Default Alt Text
D10607.id28048.diff (1 KB)
Attached To
Mode
D10607: bsdgrep(1): Don't output matches with -c, -l flag, and -L flags
Attached
Detach File
Event Timeline
Log In to Comment