spack/var/spack/repos/builtin/packages/perl/protect-quotes-in-ccflags.patch
2017-10-20 16:18:24 -07:00

37 lines
1.0 KiB
Diff

From 111bd177427ec912ef9d64a6d055ca5e9abc359d Mon Sep 17 00:00:00 2001
From: Jarkko Hietaniemi <jhi@iki.fi>
Date: Wed, 28 Oct 2015 07:56:23 -0400
Subject: [PATCH] For perl #126468: protect quotes in ccflags.
---
cflags.SH | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/cflags.SH b/cflags.SH
index f3e44ad..33c6c93 100755
--- 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.
+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.
--
2.6.0