Support for old NeXTstep 3.3 sed.
authorBruno Haible <bruno@clisp.org>
Wed, 19 Oct 2011 08:38:07 +0000 (10:38 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 19 Oct 2011 09:23:47 +0000 (11:23 +0200)
* m4/absolute-header.m4 (gl_ABSOLUTE_HEADER_ONE): In the sed address
part, use /.../, not \|...|. Escape periods in the header file name.
* m4/include_next.m4 (gl_NEXT_HEADERS_INTERNAL): Likewise.
Reported by Daniel Richard G. <skunk@iskunk.org>.

ChangeLog
m4/absolute-header.m4
m4/include_next.m4

index fc5e22e..19bd179 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-10-19  Bruno Haible  <bruno@clisp.org>
+
+       Support for old NeXTstep 3.3 sed.
+       * m4/absolute-header.m4 (gl_ABSOLUTE_HEADER_ONE): In the sed address
+       part, use /.../, not \|...|. Escape periods in the header file name.
+       * m4/include_next.m4 (gl_NEXT_HEADERS_INTERNAL): Likewise.
+       Reported by Daniel Richard G. <skunk@iskunk.org>.
+
 2011-10-18  Daniel Richard G.  <skunk@iskunk.org>  (tiny change)
 
        Support for old NeXTstep 3.3 gcc.
index b7276a3..400de55 100644 (file)
@@ -1,4 +1,4 @@
-# absolute-header.m4 serial 15
+# absolute-header.m4 serial 16
 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -78,11 +78,16 @@ changequote(,)
       gl_dirsep_regex='[/\\]'
       ;;
     *)
-      gl_dirsep_regex='/'
+      gl_dirsep_regex='\/'
       ;;
   esac
-  gl_absolute_header_sed='\|'"${gl_dirsep_regex}"'$1|{
-      s|.*"\(.*'"${gl_dirsep_regex}"'$1\)".*|\1|
+  dnl A sed expression that turns a string into a basic regular
+  dnl expression, for use within "/.../".
+  gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo '$1' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
       s|^/[^/]|//&|
       p
       q
index d5230ce..8a1fab6 100644 (file)
@@ -1,4 +1,4 @@
-# include_next.m4 serial 22
+# include_next.m4 serial 23
 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -219,12 +219,17 @@ changequote(,)
                    gl_dirsep_regex='[/\\]'
                    ;;
                  *)
-                   gl_dirsep_regex='/'
+                   gl_dirsep_regex='\/'
                    ;;
                esac
+               dnl A sed expression that turns a string into a basic regular
+               dnl expression, for use within "/.../".
+               gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
 changequote([,])
-               gl_absolute_header_sed='\|'"${gl_dirsep_regex}"']m4_defn([gl_HEADER_NAME])[|{
-                   s|.*"\(.*'"${gl_dirsep_regex}"']m4_defn([gl_HEADER_NAME])[\)".*|\1|
+               gl_header_literal_regex=`echo ']m4_defn([gl_HEADER_NAME])[' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
 changequote(,)dnl
                    s|^/[^/]|//&|
 changequote([,])dnl