mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-01-27 01:27:58 +00:00
* read.c (eval): [SV 41677] Correct test for TAB vs. 8 spaces.
This commit is contained in:
parent
8d577c2ff4
commit
55c00544cc
2 changed files with 25 additions and 1 deletions
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 a new issue