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
@ -26,7 +26,7 @@ case "${1:-.}${2:-.}${3:-.}" in
|
||||
fi
|
||||
if test -f "$4"; then
|
||||
rm -f -- "$4" &&
|
||||
rmdir -p "$(expr "$4" : '\(.*\)/')" 2>/dev/null || :
|
||||
rmdir -p "$(expr "z$4" : 'z\(.*\)/')" 2>/dev/null || :
|
||||
fi &&
|
||||
exec git-update-index --remove -- "$4"
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user