https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=105221
Kyle Evans <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected], | |[email protected] --- Comment #3 from Kyle Evans <[email protected]> --- Some notes: bsdgrep(1) is also affected in a different way by this old, old bug, so some notes: gnugrep currently in base still exhibits the original behavior bsdgrep will match the string textproc/gnugrep will fail to match, presumably because it matches the 0-length BOL at the beginning of the string and the character immediately following it ("q") is a word character Here's some other interesting behavior from textproc/gnugrep: $ echo "" | fgrep -w "" # Empty string, exit = 0, OK, that's..interesting $ echo "qaz" | fgrep -w "" # exit = 1, expected $ echo " qaz" | fgrep -w "" qaz $ printf "" | fgrep -w "" # exit = 1, expected On one hand, I don't agree with the idea that a 0-length match can *ever* produce a whole-word match- this seems misleading and probably not a practical use case. On the other hand, this is technically correct behavior because the 0-length match is at the beginning of the string with a non-word-character on its other side. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ [email protected] mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "[email protected]"
