Browse Source

git-sh-setup.sh: use dashdash with basename call

Calling basename on a argument that starts with a dash, like a login
shell, will result in an error. Add '--' before the argument so that
the argument is interpreted properly.

Signed-off-by: Dan Wyand <danwyand@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Dan Wyand 10 years ago committed by Junio C Hamano
parent
commit
7d665f3584
  1. 2
      git-sh-setup.sh

2
git-sh-setup.sh

@ -81,7 +81,7 @@ if test -n "$OPTIONS_SPEC"; then @@ -81,7 +81,7 @@ if test -n "$OPTIONS_SPEC"; then
echo exit $?
)"
else
dashless=$(basename "$0" | sed -e 's/-/ /')
dashless=$(basename -- "$0" | sed -e 's/-/ /')
usage() {
die "usage: $dashless $USAGE"
}

Loading…
Cancel
Save