FreeBSD Bugzilla – Attachment 215428 Details for
Bug 247126
zgrep(1) does not handle -f FILE correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
revised patch
patch2.txt (text/plain), 1.66 KB, created by
Craig Leres
on 2020-06-10 19:42:07 UTC
(
hide
)
Description:
revised patch
Filename:
MIME Type:
Creator:
Craig Leres
Created:
2020-06-10 19:42:07 UTC
Size:
1.66 KB
patch
obsolete
>--- zfgrep.orig 2020-06-10 12:18:32.911412000 -0700 >+++ zfgrep 2020-06-10 12:26:20.706526000 -0700 >@@ -75,18 +75,26 @@ > do > case $1 in > # from GNU grep-2.5.1 -- keep in sync! >- -[ABCDXdefm]) >+ --) >+ shift >+ endofopts=1 >+ ;; >+ --*) >+ grep_args="${grep_args} $1" >+ shift >+ ;; >+ -*[ABCDXdefm]) > if [ $# -lt 2 ] > then > echo "${prg}: missing argument for $1 flag" >&2 > exit 1 > fi > case $1 in >- -e) >- pattern="$2" >+ -*[ef]) >+ # -e: the pattern is the next argument >+ # -f: the pattern(s) is/are in a file >+ pattern="" > pattern_found=1 >- shift 2 >- break > ;; > *) > ;; >@@ -94,10 +102,6 @@ > grep_args="${grep_args} $1 $2" > shift 2 > ;; >- --) >- shift >- endofopts=1 >- ;; > -) > hyphen=1 > shift >@@ -143,15 +147,24 @@ > if [ $# -lt 1 ] > then > # ... on stdin >- ${cattool} ${catargs} - | ${grep} ${grep_args} -- "${pattern}" - || ret=$? >+ if [ -n "${pattern}" ]; then >+ ${cattool} ${catargs} - | ${grep} ${grep_args} -- "${pattern}" - || ret=$? >+ else >+ ${cattool} ${catargs} - | ${grep} ${grep_args} -- - || ret=$? >+ fi > else > # ... on all files given on the command line > if [ ${silent} -lt 1 -a $# -gt 1 ]; then > grep_args="-H ${grep_args}" > fi > for file; do >- ${cattool} ${catargs} -- "${file}" | >- ${grep} --label="${file}" ${grep_args} -- "${pattern}" - || ret=$? >+ if [ -n "${pattern}" ]; then >+ ${cattool} ${catargs} -- "${file}" | >+ ${grep} --label="${file}" ${grep_args} -- "${pattern}" - || ret=$? >+ else >+ ${cattool} ${catargs} -- "${file}" | >+ ${grep} --label="${file}" ${grep_args} -- - || ret=$? >+ fi > done > fi >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 247126
:
215407
| 215428 |
215867