[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
builtins/getopt.c is broken. last working one was 2.05a
From: |
Christos . Zoulas |
Subject: |
builtins/getopt.c is broken. last working one was 2.05a |
Date: |
Fri, 4 Apr 2003 16:24:04 +0000 (GMT) |
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -O2
uname output: Linux csrs16.nyc.twosigma.com 2.4.18-14bigmem #1 SMP Wed Sep 4
11:58:10 EDT 2002 i686 i686 i386 GNU/Linux
Machine Type: i686-pc-linux-gnu
Bash Version: 2.05b
Patch Level: 0
Release Status: release
Description:
$OPTIND gets incremented on unmatched option.
This really sucks because RedHat-8.0 ships with 2.05b :-(
Repeat-By:
- snip -
#!/bin/sh
while getopts dB:I:p:vX:P: f
do
case "$f" in
\?) break;;
esac
done
expr $OPTIND
- snip -
The above script if invoked as `./foo -S'
printed 1 before, now it prints 2.
Fix:
Revert to the 2.05a version
- builtins/getopt.c is broken. last working one was 2.05a,
Christos . Zoulas <=