From 55c00544cc2ae2a91471d3ffdc3ca1974061387a Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 7 Jul 2014 03:43:57 -0400 Subject: * read.c (eval): [SV 41677] Correct test for TAB vs. 8 spaces. --- read.c | 2 +- tests/scripts/variables/special | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/read.c b/read.c index 1fe229b..fe33ab2 100644 --- a/read.c +++ b/read.c @@ -1123,7 +1123,7 @@ 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... */ - if (cmd_prefix == '\t' && !strneq (line, " ", 8)) + if (cmd_prefix == '\t' && strneq (line, " ", 8)) O (fatal, fstart, _("missing separator (did you mean TAB instead of 8 spaces?)")); else O (fatal, fstart, _("missing separator")); diff --git a/tests/scripts/variables/special b/tests/scripts/variables/special index 4637b2a..a5ab93a 100644 --- a/tests/scripts/variables/special +++ b/tests/scripts/variables/special @@ -114,4 +114,28 @@ reset-four \ : foo-three : foo-four'); +# Test that the "did you mean TAB" message is printed properly + +run_make_test(q! +$x. +!, + '', '#MAKEFILE#:2: *** missing separator. Stop.', 512); + +run_make_test(q! +foo: + bar +!, + '', '#MAKEFILE#:3: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.', 512); + +run_make_test(q! +.RECIPEPREFIX = : +foo: + bar +!, + '', '#MAKEFILE#:4: *** missing separator. Stop.', 512); + 1; + +### Local Variables: +### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action)) +### End: -- cgit v1.2.3