* read.c (eval): [SV 41677] Correct test for TAB vs. 8 spaces.
authorPaul Smith <psmith@gnu.org>
Mon, 7 Jul 2014 07:43:57 +0000 (03:43 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 7 Jul 2014 07:43:57 +0000 (03:43 -0400)
read.c
tests/scripts/variables/special

diff --git a/read.c b/read.c
index 1fe229bb0b13f684585f70f51682e3a58c80ff69..fe33ab29da3887d550ec6d71098b511961e4ce4c 100644 (file)
--- 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"));
index 4637b2a25a4f02866554f709fda3558a256fc6fb..a5ab93aa0528d7039f1e57ef20a6e2975a57aab1 100644 (file)
@@ -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: