Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-sh-setup: fix parseopt `eval` string underquoting
author
Junio C Hamano
<gitster@pobox.com>
Thu, 8 Nov 2007 07:04:38 +0000
(23:04 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 8 Nov 2007 07:10:10 +0000
(23:10 -0800)
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>
git-sh-setup.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
dfdd7e6
)
diff --git
a/git-sh-setup.sh
b/git-sh-setup.sh
index e1cf885983f60c66472ccfa3c4b9e66b60255866..f1c4839a9fe2883f1106d9f9ee209fe4b53b3720 100755
(executable)
--- a/
git-sh-setup.sh
+++ b/
git-sh-setup.sh
@@
-21,11
+21,12
@@
if test -n "$OPTIONS_SPEC"; then
exec "$0" -h
}
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"
else
usage() {
die "Usage: $0 $USAGE"