FreeBSD Bugzilla – Attachment 215407 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]
patch
patch.txt (text/plain), 1.16 KB, created by
Craig Leres
on 2020-06-09 21:53:49 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Craig Leres
Created:
2020-06-09 21:53:49 UTC
Size:
1.16 KB
patch
obsolete
>--- zgrep.sh.orig 2020-06-09 14:43:35.031947000 -0700 >+++ zgrep.sh 2020-06-09 14:42:51.918720000 -0700 >@@ -88,6 +88,11 @@ > shift 2 > break > ;; >+ -f) >+ # the pattern in is a file, not on the command line >+ pattern="" >+ pattern_found=1 >+ ;; > *) > ;; > esac >@@ -143,15 +148,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