Package: dlocate
Version: 0.5-0.2
Severity: normal

Hi,

easy to reproduce:

[EMAIL PROTECTED]:~ $ dlocate vmlinuz-2.6.17-1-686 vmlinuz-2.6.16-2-686
linux-image-2.6.16-2-686: /boot/vmlinuz-2.6.16-2-686
[EMAIL PROTECTED]:~ $ dlocate vmlinuz-2.6.16-2-686 vmlinuz-2.6.17-1-686
linux-image-2.6.17-1-686: /boot/vmlinuz-2.6.17-1-686
[EMAIL PROTECTED]:~ $ dlocate vmlinuz-2.6.16-2-686
linux-image-2.6.16-2-686: /boot/vmlinuz-2.6.16-2-686

The bug is obviuosly here:

OPTION="$1" ; shift

Then it checks if the option is of the form: ""|"-h"|"-H"|"--help",
if yes the help is printed. Then it checks, if there are more options
after $1. If yes, $1 is evaluated. If not, $2, $3 etc. are evaluated:

PKG=$1
[ -z "$1" ] && PKG="$OPTION"

while [ -n "$PKG" ] ; do
case "$OPTION" in

<snip>

esac

shift
PKG=$1
done

I guess the first shift should only be done if $1 is a valid option
of dlocate.

H.
-- 
sigmentation fault


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to