This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
For perl #126468: protect quotes in myccflags.
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 28 Oct 2015 11:56:23 +0000 (07:56 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 29 Oct 2015 13:06:15 +0000 (09:06 -0400)
Fixes a problem introduced by 57d2761b where ccflags contents
with quotes got broken by the quotes getting stripped.

cflags.SH

index f3e44ad..ec70ed2 100755 (executable)
--- a/cflags.SH
+++ b/cflags.SH
@@ -387,6 +387,9 @@ echo "cflags.SH: warn     = $warn"
 # Code to set any extra flags here.
 extra=''
 
+# Protect double or single quotes for better restoring of ccflags.
+myccflags=`echo $ccflags | sed -e 's/"/\\\"/g' -e "s/'/\\\'/g"`
+
 echo "Extracting cflags (with variable substitutions)"
 # This section of the file will have variable substitutions done on it.
 # Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
@@ -401,7 +404,8 @@ $startsh
 # This file is generated by cflags.SH
 
 # Used to restore possible edits by cflags.SH.
-myccflags="$ccflags"
+myccflags="$myccflags"
+
 # Extra warnings, used e.g. for gcc.
 warn="$warn"
 # Extra standardness.