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:
committed by
Junio C Hamano
parent
2283645b85
commit
f327dbced2
@ -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
|
||||
|
||||
Reference in New Issue
Block a user