+2009-04-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ Correctly treat all assignments with bogus trailing comments.
+ Before this patch, automake would silently fail to diagnose and
+ to copy into the output those variable assignments which are
+ preceded by a comment, and end in backslash newline comment.
+ * automake.in (read_am_file): When determining whether an
+ escaped newline followed by a comment is an error, correctly use
+ the parser state, not the contents of a saved comment, which
+ could still be carried over from a comment before an assignment.
+ * NEWS: Update.
+ * tests/commen11.test: New test.
+ * tests/Makefile.am: Update.
+ Report by Karl Berry.
+
2009-04-14 Karl Berry <karl@freefriends.org>
manual: improve markup: itemize list in `Extending'.
- Renamed objects also work with the `subdir-objects' option and
source file languages which Automake does not know itself.
+ - `automake' now correctly complains about variable assignments which are
+ preceded by a comment, extend over multiple lines with backslash-escaped
+ newlines, and end in a comment sign. Previous versions would silently
+ and wrongly ignore such assignments completely.
+
* Bugs introduced by 1.10:
- The `parallel-tests' driver also works on systems with a nonempty
elsif (/$COMMENT_PATTERN/o)
{
error $where, "comment following trailing backslash"
- if $saw_bk && $comment eq '';
+ if $saw_bk && $prev_state != IN_COMMENT;
# Stick comments before the incoming macro or rule.
$comment .= $spacing . $_;
comment8.test \
comment9.test \
commen10.test \
+commen11.test \
compile.test \
compile2.test \
compile_f90_c_cxx.test \
comment8.test \
comment9.test \
commen10.test \
+commen11.test \
compile.test \
compile2.test \
compile_f90_c_cxx.test \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure backslash-newline-hash combinations are diagnosed as
+# comments following a trailing backslash, even when the combination
+# follows a variable assignment that is preceded by a comment.
+
+. ./defs || Exit 1
+
+set -e
+
+cat > Makefile.am << 'END'
+# initial comment
+variable = value-before-comment \
+#
+
+# comment
+SUBDIRS = foo \
+# bar
+
+END
+
+mkdir foo
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 3.*backslash stderr
+grep 7.*backslash stderr
+: