]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Don't rely on RS = "0" to swallow the whole input as a single
authorAkim Demaille <akim@epita.fr>
Mon, 20 Mar 2000 10:30:54 +0000 (10:30 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 20 Mar 2000 10:30:54 +0000 (10:30 +0000)
record, this is not portable: mawk and nawk understand it as RS =
"".  gawk understands it as expected.

* autoconf.sh (translate_awk::BEGIN): No longer change RS.
(translate_awk::body): Move to the END.
Instead, accumulate the input in `request'.

ChangeLog
autoconf.in
autoconf.sh
bin/autoconf.in

index a17d533ade7d6e9868ccc7ad110c560f8ef3aaff..9ef440bfa6e1c7ae3b434b6cc2f73b9b11b35359 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2000-03-20  Akim Demaille  <akim@epita.fr>
+
+       Don't rely on RS = "\0" to swallow the whole input as a single
+       record, this is not portable: mawk and nawk understand it as RS =
+       "".  gawk understands it as expected.
+
+       * autoconf.sh (translate_awk::BEGIN): No longer change RS.
+       (translate_awk::body): Move to the END.
+       Instead, accumulate the input in `request'.
+
 2000-03-20  Akim Demaille  <akim@epita.fr>
 
        * doc/autoconf.texi (Testing Values and Files): Be a subsection of
index d8062eda49c4f5a24a8c66160d1ee84fbf642bed..4e010b14a614ad6d575ab8e1860dab66c48b632d 100644 (file)
@@ -324,12 +324,6 @@ divert(-1)
 EOF
   # A program to translate user tracing requests into m4 macros.
   cat >$translate_awk <<\EOF
-BEGIN {
-  # We want AWK to consider the whole file is a single record.
-  # This allows to use `\n' as a separator.
-  RS = "\0" ;
-}
-
 function trans (arg, sep)
 {
   # File name.
@@ -363,9 +357,14 @@ function error (message)
 }
 
 {
+  # Accumulate the whole input.
+  request = request $0 "\n"
+}
+
+END {
   res = ""
 
-  for (cp = $0; cp; cp = substr (cp, 2))
+  for (cp = request; cp; cp = substr (cp, 2))
     {
       char = substr (cp, 1, 1)
       if (char == "$")
index d8062eda49c4f5a24a8c66160d1ee84fbf642bed..4e010b14a614ad6d575ab8e1860dab66c48b632d 100644 (file)
@@ -324,12 +324,6 @@ divert(-1)
 EOF
   # A program to translate user tracing requests into m4 macros.
   cat >$translate_awk <<\EOF
-BEGIN {
-  # We want AWK to consider the whole file is a single record.
-  # This allows to use `\n' as a separator.
-  RS = "\0" ;
-}
-
 function trans (arg, sep)
 {
   # File name.
@@ -363,9 +357,14 @@ function error (message)
 }
 
 {
+  # Accumulate the whole input.
+  request = request $0 "\n"
+}
+
+END {
   res = ""
 
-  for (cp = $0; cp; cp = substr (cp, 2))
+  for (cp = request; cp; cp = substr (cp, 2))
     {
       char = substr (cp, 1, 1)
       if (char == "$")
index d8062eda49c4f5a24a8c66160d1ee84fbf642bed..4e010b14a614ad6d575ab8e1860dab66c48b632d 100644 (file)
@@ -324,12 +324,6 @@ divert(-1)
 EOF
   # A program to translate user tracing requests into m4 macros.
   cat >$translate_awk <<\EOF
-BEGIN {
-  # We want AWK to consider the whole file is a single record.
-  # This allows to use `\n' as a separator.
-  RS = "\0" ;
-}
-
 function trans (arg, sep)
 {
   # File name.
@@ -363,9 +357,14 @@ function error (message)
 }
 
 {
+  # Accumulate the whole input.
+  request = request $0 "\n"
+}
+
+END {
   res = ""
 
-  for (cp = $0; cp; cp = substr (cp, 2))
+  for (cp = request; cp; cp = substr (cp, 2))
     {
       char = substr (cp, 1, 1)
       if (char == "$")