summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2011-11-14 07:31:06 +0000
committerPaul Smith <psmith@gnu.org>2011-11-14 07:31:06 +0000
commit4f47fbf953faae5d38bdc4e709aa8872e3914418 (patch)
treedfbddc44d0a293c59a1621b2c363bbed671c0e7f
parent9fcd90e36cf2ae981199ea185566c71f5742a5c9 (diff)
downloadgunmake-4f47fbf953faae5d38bdc4e709aa8872e3914418.tar.gz
Be sure to start parsing prereqs in the right place even if there are
escape characters (backslashes) in the target name. See Savannah bug #33399
-rw-r--r--ChangeLog6
-rw-r--r--read.c7
-rw-r--r--tests/ChangeLog5
-rw-r--r--tests/scripts/features/double_colon9
4 files changed, 24 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b7efbeb..d765363 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-11-14 Paul Smith <psmith@gnu.org>
+
+ * read.c (eval): parse_file_seq() might shorten the string due to
+ backslash removal. Start parsing again at the colon.
+ Fixes Savannah bug #33399.
+
2011-11-13 Paul Smith <psmith@gnu.org>
* file.c (file_timestamp_cons): Match up data types to avoid warnings.
diff --git a/read.c b/read.c
index 451f395..c0a6fae 100644
--- a/read.c
+++ b/read.c
@@ -1016,16 +1016,17 @@ eval (struct ebuffer *ebuf, int set_default)
/* There's no need to be ivory-tower about this: check for
one of the most common bugs found in makefiles... */
fatal (fstart, _("missing separator%s"),
- (cmd_prefix == '\t' && !strneq(line, " ", 8))
+ (cmd_prefix == '\t' && !strneq (line, " ", 8))
? "" : _(" (did you mean TAB instead of 8 spaces?)"));
continue;
}
/* Make the colon the end-of-string so we know where to stop
- looking for targets. */
+ looking for targets. Start there again once we're done. */
*colonp = '\0';
filenames = PARSE_FILE_SEQ (&p2, struct nameseq, '\0', NULL, 0);
- *p2 = ':';
+ *colonp = ':';
+ p2 = colonp;
if (!filenames)
{
diff --git a/tests/ChangeLog b/tests/ChangeLog
index e2048ff..e2ada20 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-14 Paul Smith <psmith@gnu.org>
+
+ * scripts/features/double_colon: Check double-colon with escaped
+ filenames. See Savannah bug #33399.
+
2011-09-18 Paul Smith <psmith@gnu.org>
* scripts/features/parallelism: On re-exec make sure we preserve
diff --git a/tests/scripts/features/double_colon b/tests/scripts/features/double_colon
index cad605d..1097775 100644
--- a/tests/scripts/features/double_colon
+++ b/tests/scripts/features/double_colon
@@ -151,5 +151,14 @@ two');
unlink('result','one','two');
+# TEST 10: check for proper backslash handling
+# Savannah bug #33399
+
+run_make_test('
+a\ xb :: ; @echo one
+a\ xb :: ; @echo two
+',
+ '', "one\ntwo\n");
+
# This tells the test driver that the perl test script executed properly.
1;