* zgrep.in: Do not malfunction when given an option like -15.
Before, it could end up treating the pattern as a file name:
$ echo x | gzip | zgrep -15 x
gzip: x.gz: No such file or directory
* NEWS (Bug fixes): Mention it.
Reported by Dan Bloch via Thomas Bushnell in
https://bugs.launchpad.net/bugs/
1032831
** Bug fixes
+ zgrep no longer malfunctions with a multi-digit context option like -15.
+ Now, it passes that option to grep (equivalent to -C15) just as it does
+ for single-digit options. [bug introduced in gzip-1.3.12]
+
zmore now acts more like 'more', and is more portable to POSIXish hosts.
case $option in
(-[0123456789EFGHIKLPRTUVZabchilnoqrsuvwxyz]?*)
- arg2=-\'$(expr "X$option" : 'X-.[0-9]*\(.*\)' | sed "$escape")
- eval "set -- $arg2 "'${1+"$@"}'
- option=$(expr "X$option" : 'X\(-.[0-9]*\)');;
+ if expr "X$option" : 'X-[0-9]\+$' > /dev/null; then
+ : # Let a multi-digit, digit-only option like -10 fall through.
+ else
+ arg2=-\'$(expr "X$option" : 'X-.[0-9]*\(.*\)' | sed "$escape")
+ eval "set -- $arg2 "'${1+"$@"}'
+ option=$(expr "X$option" : 'X\(-.[0-9]*\)')
+ fi;;
(--binary-*=* | --[lm]a*=* | --reg*=*)
;;
(-[ABCDXdefm] | binary-* | --file | --[lm]a* | --reg*)