summaryrefslogtreecommitdiff
path: root/git-sh-setup.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-08 07:04:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-08 07:10:10 (GMT)
commitcbea86fd149f5d4aabdff06f87bc766d414b160e (patch)
tree6c7f9d938b1b76aa5789c2b90839461ef62059de /git-sh-setup.sh
parentdfdd7e6686833ab3c0d9af412809a5455b9573de (diff)
downloadgit-cbea86fd149f5d4aabdff06f87bc766d414b160e.zip
git-cbea86fd149f5d4aabdff06f87bc766d414b160e.tar.gz
git-cbea86fd149f5d4aabdff06f87bc766d414b160e.tar.bz2
git-sh-setup: fix parseopt `eval` string underquoting
The 'automagic parseopt' support corrupted non option parameters that had IFS characters in them. The worst case is when it had a non option parameter like this: $1=" * some string" Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-sh-setup.sh')
-rwxr-xr-xgit-sh-setup.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index e1cf885..f1c4839 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -21,11 +21,12 @@ if test -n "$OPTIONS_SPEC"; then
exec "$0" -h
}
- parseopt_extra=
- [ -n "$OPTIONS_KEEPDASHDASH" ] &&
- parseopt_extra="$parseopt_extra --keep-dashdash"
-
- eval `echo "$OPTIONS_SPEC" | git rev-parse --parseopt $parseopt_extra -- "$@" || echo exit $?`
+ [ -n "$OPTIONS_KEEPDASHDASH" ] && parseopt_extra="--keep-dashdash"
+ parsed=$(
+ echo "$OPTIONS_SPEC" |
+ git rev-parse --parseopt $parseopt_extra -- "$@"
+ ) &&
+ eval "$parsed" || exit
else
usage() {
die "Usage: $0 $USAGE"