* Ralf Wildenhues wrote on Mon, Jan 08, 2007 at 08:14:45PM CET:
> * Patrick Welche wrote on Sat, Dec 23, 2006 at 11:12:03PM CET:

> | ^I >>> S["prefix"]="/ <<< 
> | sed: stdout: Broken pipe
> 
> Not sure what to do.  Does it swallow this with escaping?  Try
>   awk 'BEGIN { x = "a\^Mb"; print x }' > file

Hmm.  The escaping of CR would certainly have to be optional, as some
awk implementations otherwise output an extra backslash.

Anyway.  Some testing reveals issues with the NUL character (mawk,
awk on FreeBSD, OpenBSD, OSF), CR (FreeBSD, OpenBSD), characters
above \127 (gawk, mawk).

Not having tested further, how about this patch to fix the Autoconf side
of this bug report?  Should we make provisions for hosts without a
suitable `printf'?  Do we intend to port to non-ASCII systems?
Do we care about CR being supported (at the cost of an extra test;
note that not supporting CR is a regression over 2.60)?

Cheers,
Ralf

2007-01-16  Ralf Wildenhues  <[EMAIL PROTECTED]>

        * doc/autoconf.texi (Setting Output Variables): Mention
        limitations in substituted variable values.
        * tests/torture.at (Substitute and define special characters):
        Test all characters we claim to support.
        Report against Automake by Patrick Welche.

Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.1125
diff -u -r1.1125 autoconf.texi
--- doc/autoconf.texi   8 Jan 2007 19:54:10 -0000       1.1125
+++ doc/autoconf.texi   16 Jan 2007 06:59:43 -0000
@@ -8354,7 +8354,8 @@
 or more makefiles).  This means that @code{AC_OUTPUT}
 replaces instances of @samp{@@@var{variable}@@} in input files with the
 value that the shell variable @var{variable} has when @code{AC_OUTPUT}
-is called.  The value can contain newlines.
+is called.  The value can contain all ASCII characters except for
+the @code{NUL} character and carriage return; newline is ok to use.
 Variable occurrences should not overlap: e.g., an input file should
 not contain @samp{@@@var{var1}@@@var{var2}@@} if @var{var1} and @var{var2}
 are variable names.
Index: tests/torture.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/torture.at,v
retrieving revision 1.79
diff -u -r1.79 torture.at
--- tests/torture.at    20 Dec 2006 00:09:44 -0000      1.79
+++ tests/torture.at    16 Jan 2007 06:59:44 -0000
@@ -632,18 +632,34 @@
 [EMAIL PROTECTED]@@bar@
 ])
 
+AT_DATA([Zardoz.in], [EMAIL PROTECTED]@
+])
+
 AT_CONFIGURE_AC(
 [[foo="AS@&[EMAIL PROTECTED]([[X*'[]+ ",& &`\($foo \& \\& \\\& \\\\& \ \\ \\\ 
!]])"
 bar="@foo@ @baz@"
 baz=bla
+for i in 0 1; do
+  for j in 0 1 2 3 4 5 6 7; do
+    for k in 0 1 2 3 4 5 6 7; do
+      case $i$j$k in
+      000 | 013) ;;
+      177) printf \\$i$j$k\\n;;
+      *) printf \\$i$j$k;;
+      esac
+    done
+  done
+done >allowed-chars
+zardoz=`cat allowed-chars`
 AC_SUBST([foo])
 AC_SUBST([bar])
 AC_SUBST([baz])
+AC_SUBST([zardoz])
 file=File
 AC_SUBST_FILE([file])
 AC_DEFINE([foo], [[X*'[]+ ",& &`\($foo !]], [Awful value.])
 AC_PROG_AWK
-AC_CONFIG_FILES([Foo])]])
+AC_CONFIG_FILES([Foo Zardoz])]])
 
 AT_CHECK_AUTOCONF
 AT_CHECK_AUTOHEADER
@@ -663,6 +679,7 @@
 [EMAIL PROTECTED]@
 @[EMAIL PROTECTED]
 ]])
+  AT_CHECK([cmp allowed-chars Zardoz])
   AT_CHECK_DEFINES([[#define foo X*'[]+ ",& &`\($foo !
 ]])
 done


Reply via email to