From: Akim Demaille Date: Mon, 20 Mar 2000 10:30:54 +0000 (+0000) Subject: Don't rely on RS = "0" to swallow the whole input as a single X-Git-Tag: autoconf-2.50~1027 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e140e3ce82e45f7efac6a3ab3049ba2860c206c4;p=thirdparty%2Fautoconf.git 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'. --- diff --git a/ChangeLog b/ChangeLog index a17d533ad..9ef440bfa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2000-03-20 Akim Demaille + + 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 * doc/autoconf.texi (Testing Values and Files): Be a subsection of diff --git a/autoconf.in b/autoconf.in index d8062eda4..4e010b14a 100644 --- a/autoconf.in +++ b/autoconf.in @@ -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 == "$") diff --git a/autoconf.sh b/autoconf.sh index d8062eda4..4e010b14a 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -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 == "$") diff --git a/bin/autoconf.in b/bin/autoconf.in index d8062eda4..4e010b14a 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -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 == "$")