[Bug 12816] New: grep does not match GNU grep for -xf EMPTY_FILE

bugzilla at busybox.net bugzilla at busybox.net
Mon Apr 27 12:22:32 UTC 2020


https://bugs.busybox.net/show_bug.cgi?id=12816

            Bug ID: 12816
           Summary: grep does not match GNU grep for -xf EMPTY_FILE
           Product: Busybox
           Version: 1.32.x
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: wolf+busybox at wolfsden.cz
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

Hello,

while implementing whitelist mechanism in my shell scripting, I've
noticed an inconsistency between busybox's grep and GNU grep. They
handle -xf EMPTY_FILE flags differently when EMPTY_FILE is well...
empty.

GNU grep in that case handles it as if /.*/ pattern was provided, while
busybox uses //.

Attached patch fixes this issue. I've both added a test case into grep's
testsuite and I've also used following shell script to verify that the
behavior does match now:

http://lists.busybox.net/pipermail/busybox/2020-April/087915.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list