Package: unzip
Version: 6.0-4
Severity: normal
File: /usr/bin/zipgrep

>From the zipgrep man page:

       zipgrep [egrep_options] pattern file[.zip] [file(s) ...]  [-x xfile(s) 
...]

       [...]

       zipgrep is a shell script and requires egrep(1) and unzip(1) to
       function.  Its output is identical to that of egrep(1).

But the following shell code from zipgrep mistreats long options like
--color or --line-buffered (both have no equivalent short option) as
short options (or similar):

opt=`echo "$opt" | sed -e 's/ //g' -e 's/-//g'`
case "$opt" in
  *l*) list=1; opt=`echo $opt | sed s/l//`
esac
case "$opt" in
  *h*) silent=1
esac
if test -n "$opt"; then
  opt="-$opt"
fi

Examples:

$ zipgrep Axel blafasel.zip
scratch/debian/mp4h/CREDITS:      Axel Beckert ................ 
<rse-...@deuxchevaux.org>
scratch/debian/mp4h/debian/control:Uploaders: Axel Beckert <a...@debian.org>
[...]
$ zipgrep --color Axel blafasel.zip
scratch/debian/mp4h/CREDITS
scratch/debian/mp4h/debian/control
[...]
$ zipgrep --color=always Axel blafasel.zip
egrep: invalid option -- '='
Usage: egrep [OPTION]... PATTERN [FILE]...
Try `egrep --help' for more information.

In the second example, the "l" in "--color" is passed as "-l" to egrep,
hence it suppresses the matches itself (and hence -o and -c are of no
effect).

In the third example "=" is passed as "-=" or so which causes egrep to
bail out due to an unknown option.

-- System Information:
Debian Release: 6.0.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages unzip depends on:
ii  libbz2-1.0                    1.0.5-6    high-quality block-sorting file co
ii  libc6                         2.11.2-10  Embedded GNU C Library: Shared lib

unzip recommends no packages.

Versions of packages unzip suggests:
ii  zip                           3.0-3      Archiver for .zip files

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to