mirror of
https://github.com/mirror/make.git
synced 2025-02-25 19:30:48 +08:00
* read.c (eval): [SV 41677] Correct test for TAB vs. 8 spaces.
This commit is contained in:
parent
8d577c2ff4
commit
55c00544cc
2
read.c
2
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"));
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user