From 51dd50b41d362a240d70db9f1d91428ccb5cce9c Mon Sep 17 00:00:00 2001 From: Paul Mansfield Date: Sat, 5 Sep 2009 23:55:22 +0100 Subject: [PATCH] Tighten the regex in Issue 6 bugfix. Checks for complete action names before escaping &'s --- todo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todo.sh b/todo.sh index 386134b..d25173d 100755 --- a/todo.sh +++ b/todo.sh @@ -248,7 +248,7 @@ cleaninput() input=`echo $input | tr -d '\r|\n'` # Check which action we are being used in as this affects what cleaning we do - if [[ $action =~ (append|app|prepend|prep|replace) ]]; then + if [[ $action =~ ^(append|app|prepend|prep|replace)$ ]]; then # These actions use sed and & as the matched string so escape it input=`echo $input | sed 's/\&/\\\&/g'` fi