texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[7893] avoid multiple levels of quoting in shell script


From: gavinsmith0123
Subject: [7893] avoid multiple levels of quoting in shell script
Date: Sat, 1 Jul 2017 16:39:24 -0400 (EDT)

Revision: 7893
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7893
Author:   gavin
Date:     2017-07-01 16:39:24 -0400 (Sat, 01 Jul 2017)
Log Message:
-----------
avoid multiple levels of quoting in shell script

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/MiscXS/configure.ac

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2017-07-01 20:21:11 UTC (rev 7892)
+++ trunk/ChangeLog     2017-07-01 20:39:24 UTC (rev 7893)
@@ -7,8 +7,11 @@
        being multiple level of quoting present which can be extremely 
        confusing, i.e., autoconf's quadrigraphs, quoting within the 
        backquoted string where sed is called, as well as sed's own 
-       escaping of special characters. 
+       escaping of special characters.
 
+       * tp/Texinfo/MiscXS/configure.ac (fetch_conf): Make the same 
+       change.
+
 2017-07-01  Gavin Smith  <address@hidden>
 
        * info/t/c-u-m-x-scroll-forward.sh, info/t/inc-sea-insensitive.sh, 

Modified: trunk/tp/Texinfo/MiscXS/configure.ac
===================================================================
--- trunk/tp/Texinfo/MiscXS/configure.ac        2017-07-01 20:21:11 UTC (rev 
7892)
+++ trunk/tp/Texinfo/MiscXS/configure.ac        2017-07-01 20:39:24 UTC (rev 
7893)
@@ -1,6 +1,6 @@
 # configure.ac for XSParagraph
 #
-# Copyright 2015, 2016 Free Software Foundation, Inc.
+# Copyright 2015, 2016, 2017 Free Software Foundation, Inc.
 #
 # This file is free software; as a special exception the author gives
 # unlimited permission to copy and/or distribute it, with or without
@@ -14,19 +14,26 @@
 AM_INIT_AUTOMAKE
 AC_CONFIG_MACRO_DIR([m4])
 
+b='\'
+d='$'
+o='@<:@' dnl quadrigraph for [ - see autoconf documentatoin
+c='@:>@' dnl quadrigraph for ]
+
+# This turns a string like "cc='cc';" into a string like "cc".
+# Afterwards, convert \ into / in case \ is a path separator,
+# so it is not interpreted as a special character by the shell.
+
+sed_script="
+s/^$o^=$c*= *//
+s/^'//
+s/ *; *$//
+s/'$d//
+s/$b$b/$b//g"
+
 fetch_conf ()
 {
           conf_value=`${PERL} -V:$1`
-          # This turns a string like "cc='cc';" into a string like "cc".
-          # Afterwards, convert \ into / in case \ is a path separator,
-          # so it is not interpreted as a special character by the shell.
-          conf_value=`echo $conf_value \
-              | sed -e 's/^@<:@^=@:>@*= *//'   \
-                    -e 's/^'\\''//'            \
-                    -e 's/ *; *$//'            \
-                    -e 's/'\\''$//'            \
-                    -e 's/\\\\/\\//g'          `
-          #echo got "$conf_value"
+          conf_value=`echo $conf_value | sed "$sed_script"`
 } 
 
 AC_DEFUN([lookup_perl_conf],




reply via email to

[Prev in Thread] Current Thread [Next in Thread]