Skip to content

Commit

Permalink
sh-setup: don't let eval output to be shell-expanded.
Browse files Browse the repository at this point in the history
The previous patch missed the same construct in git-clone.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
  • Loading branch information
Pierre Habouzit authored and Junio C Hamano committed Nov 8, 2007
1 parent cbea86f commit e817e3e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion git-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ usage() {
exec "$0" -h
}

eval `echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?`
eval "$(echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)"

get_repo_base() {
(
Expand Down
13 changes: 8 additions & 5 deletions git-sh-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ if test -n "$OPTIONS_SPEC"; then
exec "$0" -h
}

[ -n "$OPTIONS_KEEPDASHDASH" ] && parseopt_extra="--keep-dashdash"
parsed=$(
parseopt_extra=
[ -n "$OPTIONS_KEEPDASHDASH" ] &&
parseopt_extra="--keep-dashdash"

eval "$(
echo "$OPTIONS_SPEC" |
git rev-parse --parseopt $parseopt_extra -- "$@"
) &&
eval "$parsed" || exit
git rev-parse --parseopt $parseopt_extra -- "$@" ||
echo exit $?
)"
else
usage() {
die "Usage: $0 $USAGE"
Expand Down

0 comments on commit e817e3e

Please sign in to comment.