diff options
author | Jim Meyering <meyering@redhat.com> | 2011-11-12 15:10:07 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2011-11-12 15:10:07 +0100 |
commit | fc5be7ad57aec36d659878e4789ece0667397220 (patch) | |
tree | b82bd52a47c36ddda1e3db53327b69e4075b2d7b /tests | |
parent | e87a26c5857eec858da46a72312a85afd7f8305c (diff) | |
download | grep-fc5be7ad57aec36d659878e4789ece0667397220.tar.gz |
tests: make the replacement export function more robust
* tests/Makefile.am (sed_quote_value): Also quote single quotes.
Remove sed's -e options. Not needed.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index b8a5a3c6..50b57262 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -109,10 +109,10 @@ TESTS_ENVIRONMENT = \ export_with_values () \ { \ sed_extract_var='s/=.*//'; \ - sed_quote_value="s/=\\(.*\\)/='\\1'/"; \ + sed_quote_value="s/'/'\\\\''/g;s/=\\(.*\\)/='\\1'/";\ for arg in "$$@"; do \ - var=`echo "$$arg" | sed -e "$$sed_extract_var"`; \ - arg=`echo "$$arg" | sed -e "$$sed_quote_value"`; \ + var=`echo "$$arg" | sed "$$sed_extract_var"`; \ + arg=`echo "$$arg" | sed "$$sed_quote_value"`; \ eval "$$arg"; \ export "$$var"; \ done; \ |