autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: carriage return line endings vs. literal ^M in status.m4


From: Ralf Wildenhues
Subject: Re: carriage return line endings vs. literal ^M in status.m4
Date: Sat, 5 Apr 2008 14:48:21 +0200
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

* Jim Meyering wrote on Sat, Apr 05, 2008 at 02:26:40PM CEST:
> 
> Complete patch below.
> I'll point Elbert at a coreutils snapshot to test this.

How about this slightly simpler patch instead?  If you don't like it,
then I think your patch is a definite improvement, and is OK by me.

> The above-quoted use of sed also makes a point of converting ^M bytes
> that are not at end of line.  Any idea if/why that's needed?
> I've confirmed that it serves no purpose in coreutils; i.e.,
> its subs1.awk contains no embedded CR.

Well, if you had
  AC_SUBST([variable_that_contains_cr], ["
"])

then it would make a difference.  The original aim was that users should
be able to substitute any characters they like (except for \0).  And the
above is not so unlikely if the configure script itself happens to be
converted to w32 text mode.

Thanks,
Ralf

diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4
index 09ec312..e4daa38 100644
--- a/lib/autoconf/status.m4
+++ b/lib/autoconf/status.m4
@@ -542,13 +542,12 @@ _ACEOF
 dnl See if CR is the EOL marker.  If not, remove any EOL-related
 dnl ^M bytes and escape any remaining ones.  If so, just use mv.
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_awk_err=0
-sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1 \
-  && { sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" \
-        < "$tmp/subs1.awk" > "$tmp/subs.awk" || ac_awk_err=1; } \
-  || { mv "$tmp/subs1.awk"   "$tmp/subs.awk" || ac_awk_err=1; }
-test $ac_awk_err = 1 \
-  && AC_MSG_ERROR([could not setup config files machinery])
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" ||
+  AC_MSG_ERROR([could not setup config files machinery])
 _ACEOF
 
 # VPATH may cause trouble with some makes, so we remove $(srcdir),




reply via email to

[Prev in Thread] Current Thread [Next in Thread]