* automake.in (read_am_file): Catch trailing backslashes on last line.
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 25 Feb 2003 17:30:54 +0000 (17:30 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 25 Feb 2003 17:30:54 +0000 (17:30 +0000)
* tests/backsl3.test: New file.
* tests/Makefile.am (TESTS): Add backsl3.test.
Reported by Akim Demaille.

ChangeLog
automake.in
tests/Makefile.am
tests/Makefile.in
tests/backsl3.test [new file with mode: 0755]

index 3b555fd8fdeea140bb9a524714c5542d43d58d66..002fed610b0ddba699380e15e12649784fd01c19 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-02-25  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * automake.in (read_am_file): Catch trailing backslashes on last line.
+       * tests/backsl3.test: New file.
+       * tests/Makefile.am (TESTS): Add backsl3.test.
+       Reported by Akim Demaille.
+
 2003-02-24  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * ChangeLog: Move 2002's entries to ...
index 840b643c046799cbe078587facf00961302ff24d..674ffd167e7f8b3f12aebe54bb0d4937caf24bd0 100755 (executable)
@@ -7625,6 +7625,9 @@ sub read_am_file ($$)
 
     $output_trailer .= $comment;
 
+    error ($where, "trailing backslash on last line")
+      if $saw_bk;
+
     error ($where, (@cond_stack ? "unterminated conditionals: @cond_stack"
                    : "too many conditionals closed in include file"))
       if "@saved_cond_stack" ne "@cond_stack";
index 8c3f92161a74a4560695546a5846bef5902aaee3..284117a882e1daeda28ce071b110b050f12f6307 100644 (file)
@@ -40,6 +40,7 @@ auxdir.test \
 auxdir2.test \
 backsl.test \
 backsl2.test \
+backsl3.test \
 badline.test \
 badprog.test \
 block.test \
index c6caa3f4a3881d1aa89b13210fe591a81d80fb4a..71994a3a33d27a0d6f5648ec0e696aa298220d46 100644 (file)
@@ -134,6 +134,7 @@ auxdir.test \
 auxdir2.test \
 backsl.test \
 backsl2.test \
+backsl3.test \
 badline.test \
 badprog.test \
 block.test \
diff --git a/tests/backsl3.test b/tests/backsl3.test
new file mode 100755 (executable)
index 0000000..bb465e4
--- /dev/null
@@ -0,0 +1,35 @@
+#! /bin/sh
+# Copyright (C) 2003  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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 2, or (at your option)
+# any later version.
+#
+# GNU Automake 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 Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Make sure we diagnose trailing backslash at the end of a file.
+# Report from Akim Demaile <akim@epita.fr>
+
+. ./defs || exit 1
+
+set -e
+
+cat > Makefile.am << 'END'
+foo = \
+END
+
+$ACLOCAL
+$AUTOMAKE 2>stderr && exit 1
+cat stderr
+grep 'trailing backslash' stderr