Fixed getopts/OPTIND handling.
authorshort <>
Tue, 28 Dec 2004 09:04:54 +0000 (09:04 +0000)
committershort <>
Tue, 28 Dec 2004 09:04:54 +0000 (09:04 +0000)
 - Suggested by Chet Ramey.

.bashrc

diff --git a/.bashrc b/.bashrc
index 432ac97..65f8e40 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -17,11 +17,9 @@ if [ -f /etc/bashrc ];then source /etc/bashrc;fi
 
 function _bash_profile_addpath # <variablename>,<dirpathname>
 {
-       # FIXME: local OPTIND
-       # see also: <20041223083747.GA9955@kobhome.dyn.jankratochvil.net>
-       unset OPTIND
        local _varname _dirpathname _opt_f _opt_s
        _opt_f=0;_opt_s=0
+       unset OPTIND
        while getopts fs got;do
                case "$got" in
                        [fs]) eval "_opt_$got=1" ;;
@@ -195,7 +193,7 @@ function revlines { perl -e 'my @r=();push @r,$_ while (<>);print pop @r while @
 ulimit -c 0
 set +H
 shopt -s mailwarn
-unset OPTIND   # FIXME; see also: <20041223083747.GA9955@kobhome.dyn.jankratochvil.net>
+unset OPTIND
 
 if [ -f "$HOME/.bashrc.local" ];then source "$HOME/.bashrc.local";fi