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
@ -20,7 +20,7 @@ case "$1" in -v) verbose=t; shift ;; esac
|
||||
|
||||
case "$#,$1" in
|
||||
1,*..*)
|
||||
upstream=$(expr "$1" : '\(.*\)\.\.') ours=$(expr "$1" : '.*\.\.\(.*\)$')
|
||||
upstream=$(expr "z$1" : 'z\(.*\)\.\.') ours=$(expr "z$1" : '.*\.\.\(.*\)$')
|
||||
set x "$upstream" "$ours"
|
||||
shift ;;
|
||||
esac
|
||||
|
Reference in New Issue
Block a user