Shell utilities: Guard against expr' magic tokens.

Some words, e.g., `match', are special to expr(1), and cause strange
parsing effects.  Track down all uses of expr and mangle the arguments
so that this isn't a problem.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Mark Wooding
2006-04-13 22:01:24 +00:00
committed by Junio C Hamano
parent 2283645b85
commit f327dbced2
9 changed files with 30 additions and 30 deletions

View File

@ -94,7 +94,7 @@ case "$#" in
;;
*)
branch_name=`git symbolic-ref HEAD` || die "No current branch"
branch_name=`expr "$branch_name" : 'refs/heads/\(.*\)'`
branch_name=`expr "z$branch_name" : 'zrefs/heads/\(.*\)'`
;;
esac
branch=$(git-rev-parse --verify "${branch_name}^0") || exit