+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
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.
}
{
+ # 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 == "$")
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.
}
{
+ # 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 == "$")
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.
}
{
+ # 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 == "$")