aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2002-01-15 23:14:52 +0000
committerFrederic Lepied <flepied@mandriva.com>2002-01-15 23:14:52 +0000
commitc8fe4a7b7b7878b9720e4e81f5e003d688035431 (patch)
tree7e18faf92f6cd43f26acd0b3142b79688282adac
parent55337d1c203a12078620247fcc480714cc35b586 (diff)
downloadspec-helper-c8fe4a7b7b7878b9720e4e81f5e003d688035431.tar
spec-helper-c8fe4a7b7b7878b9720e4e81f5e003d688035431.tar.gz
spec-helper-c8fe4a7b7b7878b9720e4e81f5e003d688035431.tar.bz2
spec-helper-c8fe4a7b7b7878b9720e4e81f5e003d688035431.tar.xz
spec-helper-c8fe4a7b7b7878b9720e4e81f5e003d688035431.zip
protect variables by surrounding them them ""
-rwxr-xr-xgprintify.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gprintify.py b/gprintify.py
index 134e9ef..4a60104 100755
--- a/gprintify.py
+++ b/gprintify.py
@@ -15,7 +15,7 @@ import sys
import re
echo_regex=re.compile('^(.*)echo +(-[en]+)?')
-string_regex=re.compile('^(.*?)\$?"([^"]*?)"([^>\|\[\]]*|.*\|\|.*)$')
+string_regex=re.compile('^([^"]*?)\$?"([^"]*[^\\\\])"([^>\|\[\]]*|.*\|\|.*)$')
var_regex=re.compile('(\$[a-zA-Z0-9_{}]+(?:\[\$[a-zA-Z0-9_{}]+\])?}?)')
init_func_regex=re.compile('(.*(daemon|action|success|failure|passed)\s*.*)')
@@ -36,7 +36,7 @@ def process_vars(str, trail):
if var_res:
ret=var_regex.sub('%s', str) + trail
for v in var_res:
- ret = ret + ' ' + v
+ ret = ret + ' "' + v + '"'
return ret
else:
return str + trail