From f327dbced25a3c6fcc0b84d2d6adffa9343b09f0 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 13 Apr 2006 22:01:24 +0000 Subject: 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 Signed-off-by: Junio C Hamano --- git-cherry.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-cherry.sh') diff --git a/git-cherry.sh b/git-cherry.sh index 1a6232013..f0e8831fa 100755 --- a/git-cherry.sh +++ b/git-cherry.sh @@ -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 -- cgit v1.2.1