autoconf/tests
Zack Weinberg bfd3894367 config.status: handle CRLF line endings in AC_CONFIG_HEADERS input
On systems that normally use Unix line endings, if config.h.in has
somehow been generated with DOS line endings, then awk will treat
each CR character as part of the line.  This breaks the regular
expressions used to edit config.h.in into config.h

To fix, manually strip trailing CRs from each “input record” before
any other processing.  For consistency I also made this change to the
code dealing with AC_CONFIG_FILES substitutions.  On systems that use
DOS line endings, both changes should be no-ops.

Reported by David Allsopp in <https://savannah.gnu.org/support/?110554>.
He offered a different patch, which also worked on my machine, but it
used a regular expression as the third argument to ‘split’, which
might not be portable across awk implementations (the gawk manual is
unclear).  Also, it could produce a config.h with _inconsistent_ line
endings.

* lib/autoconf/status.m4 (_AC_OUTPUT_HEADERS_PREPARE): In the awk
  script, strip a trailing CR from each record as the first action.
  (_AC_OUTPUT_FILES_PREPARE): Likewise.
* tests/torture.at (CRLF line endings in .in files): New test.

Co-authored-by: David Allsopp <david@davidallsopp.com>
2023-12-15 10:59:38 -05:00
..
data spelling fixes 2023-01-21 00:58:47 -06:00
atlocal.in make update-copyright 2023-01-20 23:41:13 -06:00
autoscan.at make update-copyright 2023-01-20 23:41:13 -06:00
autotest.at tests: avoid an unwarranted test failure 2023-03-26 22:08:02 -07:00
base.at make update-copyright 2023-01-20 23:41:13 -06:00
c.at Cater to programs misusing AC_EGREP_HEADER 2023-03-31 10:47:49 -07:00
compile.at make update-copyright 2023-01-20 23:41:13 -06:00
erlang.at make update-copyright 2023-01-20 23:41:13 -06:00
foreign.at make update-copyright 2023-01-20 23:41:13 -06:00
fortran.at make update-copyright 2023-01-20 23:41:13 -06:00
go.at make update-copyright 2023-01-20 23:41:13 -06:00
local.at autom4te: report subsecond timestamp support in --version 2023-12-06 15:57:05 -05:00
local.mk make update-copyright 2023-01-20 23:41:13 -06:00
m4sh.at spelling fixes 2023-01-21 00:58:47 -06:00
m4sugar.at make update-copyright 2023-01-20 23:41:13 -06:00
mktests.pl Make AC_PROG_GCC_TRADITIONAL a compatibility alias for AC_PROG_CC. 2023-04-02 23:01:06 -04:00
semantics.at make update-copyright 2023-01-20 23:41:13 -06:00
statesave.m4 make update-copyright 2023-01-20 23:41:13 -06:00
suite.at make update-copyright 2023-01-20 23:41:13 -06:00
tools.at autom4te: report subsecond timestamp support in --version 2023-12-06 15:57:05 -05:00
torture.at config.status: handle CRLF line endings in AC_CONFIG_HEADERS input 2023-12-15 10:59:38 -05:00
wrapper.as make update-copyright 2023-01-20 23:41:13 -06:00