summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/perl/protect-quotes-in-ccflags.patch
blob: f3500d52f74b58c484300d537e35f96ee10cf806 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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