[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
PR280.patch
From: |
Alexandre Duret-Lutz |
Subject: |
PR280.patch |
Date: |
29 Dec 2001 15:31:20 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
Index: ChangeLog
--- ChangeLog
+++ ChangeLog
@@ -1,1 +1,10 @@
+2001-12-29 Alexandre Duret-Lutz <address@hidden>
+
+ Fix for PR automake/280:
+ * automake.in (read_am_file): Warn about trailing backslashes
+ in comments.
+ * tests/comment5.test: New file.
+ * tests/Makefile.am (TESTS): Add comment5.test.
+ Reported by Enrico Scholz.
+
Index: automake.in
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011221-1107/automake.in,v
retrieving revision 1.2
diff -u -r1.2 automake.in
--- automake.in 29 Dec 2001 13:29:58 -0000 1.2
+++ automake.in 29 Dec 2001 14:23:38 -0000
@@ -6679,6 +6679,7 @@
my $spacing = '';
my $comment = '';
my $blank = 0;
+ my $saw_bk = 0;
while ($_ = $am_file->getline)
{
@@ -6688,6 +6689,9 @@
}
elsif (/$WHITE_PATTERN/o)
{
+ file_error ("$amfile:$.",
+ "blank line following trailing backslash")
+ if $saw_bk;
# Stick a single white line before the incoming macro or rule.
$spacing = "\n";
$blank = 1;
@@ -6711,6 +6715,7 @@
{
last;
}
+ $saw_bk = /\\$/ && ! /$IGNORE_PATTERN/o;
}
# We save the conditional stack on entry, and then check to make
@@ -6719,7 +6724,6 @@
my @saved_cond_stack = @cond_stack;
my $cond = conditional_string (@cond_stack);
- my $saw_bk = 0;
my $was_rule = 0;
my $last_var_name = '';
my $last_var_type = '';
@@ -6738,7 +6742,7 @@
$_ =~ s/address@hidden@//g
unless $seen_maint_mode;
- my $new_saw_bk = /\\$/ && ! /$COMMENT_PATTERN/o;
+ my $new_saw_bk = /\\$/ && ! /$IGNORE_PATTERN/o;
if (/$IGNORE_PATTERN/o)
{
@@ -6757,7 +6761,7 @@
$comment .= $spacing . $_;
$spacing = '';
file_error ($here, "comment following trailing backslash")
- if $saw_bk;
+ if $saw_bk && $comment ne '';
}
elsif ($saw_bk)
{
Index: tests/Makefile.am
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011221-1107/tests/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- tests/Makefile.am 29 Dec 2001 13:29:59 -0000 1.2
+++ tests/Makefile.am 29 Dec 2001 14:26:01 -0000
@@ -54,6 +54,7 @@
comment2.test \
comment3.test \
comment4.test \
+comment5.test \
compile_f_c_cxx.test \
cond.test \
cond2.test \
Index: tests/Makefile.in
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011221-1107/tests/Makefile.in,v
retrieving revision 1.2
diff -u -r1.2 Makefile.in
--- tests/Makefile.in 29 Dec 2001 13:29:59 -0000 1.2
+++ tests/Makefile.in 29 Dec 2001 14:26:04 -0000
@@ -126,6 +126,7 @@
comment2.test \
comment3.test \
comment4.test \
+comment5.test \
compile_f_c_cxx.test \
cond.test \
cond2.test \
Index: tests/comment5.test
===================================================================
RCS file: tests/comment5.test
diff -N tests/comment5.test
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/comment5.test 29 Dec 2001 14:12:41 -0000
@@ -0,0 +1,40 @@
+#! /bin/sh
+# Test for PR/280.
+# (Automake should complain about trailing backslashes in comments.)
+
+. $srcdir/defs || exit 1
+
+set -e
+
+cat >> configure.in <<'EOF'
+AC_OUTPUT
+EOF
+
+cat > Makefile.am << 'EOF'
+all-local:
+ @echo ${var}
+
+# a comment with backslash \
+
+
+var = foo
+EOF
+
+$ACLOCAL
+$AUTOMAKE && exit 1
+
+## Here is a second test because head comments are
+## handled differently in Automake 1.5.
+
+cat > Makefile.am << 'EOF'
+# a comment with backslash \
+
+
+all-local:
+ @echo ${var}
+
+var = foo
+EOF
+
+$AUTOMAKE && exit 1
+:
--
Alexandre Duret-Lutz
- PR280.patch,
Alexandre Duret-Lutz <=