From e817e3e8579742312534f20c0946cd3c562cfa7c Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Thu, 8 Nov 2007 10:32:11 +0100 Subject: [PATCH] sh-setup: don't let eval output to be shell-expanded. The previous patch missed the same construct in git-clone. Signed-off-by: Pierre Habouzit --- git-clone.sh | 2 +- git-sh-setup.sh | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/git-clone.sh b/git-clone.sh index f216f03a7..24ad179bb 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -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() { ( diff --git a/git-sh-setup.sh b/git-sh-setup.sh index f1c4839a9..5aa62dda1 100755 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -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" -- 2.30.2