summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxhe <xw897002528@gmail.com>2019-04-05 10:00:21 +0800
committerxhe <xw897002528@gmail.com>2019-04-05 10:06:23 +0800
commita597aaebd15ef73a65d67f0d6f746ca7ca812d51 (patch)
tree10a4b749a7c92f02803ddb4b6fb4dc9302777146
parentc6dcdcdef801127549d3906d153c061880d25a73 (diff)
downloadgettext-tiny-a597aaebd15ef73a65d67f0d6f746ca7ca812d51.tar.gz
xgettext: parse arguments correctly
`*) break` will stop parsing immediately after the first argument is parsed, leaving all other arguments ignored. To prevent shifting arguments more than we have, we should check if there's any argument left. Otherwise, script will exit with `can not shift anymore`.
-rwxr-xr-xsrc/xgettext.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/xgettext.sh b/src/xgettext.sh
index 670b96d..fc38369 100755
--- a/src/xgettext.sh
+++ b/src/xgettext.sh
@@ -20,7 +20,7 @@ show_version() {
exit 0
}
-while true ; do
+while [ $# -gt 0 ] ; do
case $1 in
#--files-from=*) readfile `spliteq "$1"`;;
#-f) expectfilefrom=1;;
@@ -97,7 +97,6 @@ while true ; do
-M*) : ;;
--help) syntax ;;
-h) syntax ;;
- *) break ;;
esac
shift
done