Module Name: src
Committed By: rillig
Date: Sat Oct 17 20:32:20 UTC 2020
Modified Files:
src/usr.bin/make: parse.c
Log Message:
make(1): remove dead and broken warning for novices
In non-POSIX mode (which can only be enabled by editing config.h),
having a shell command indented by spaces instead of tabs would generate
a warning, and then, contrary to the comment above the code, no command
would be added to the current targets, since *cp == '\0'.
This had been broken since parse.c 1.133 on 2007-02-24, therefore it
seems unnecessary to even try to fix this code.
To generate a diff of this commit:
cvs rdiff -u -r1.377 -r1.378 src/usr.bin/make/parse.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.377 src/usr.bin/make/parse.c:1.378
--- src/usr.bin/make/parse.c:1.377 Sat Oct 17 19:10:07 2020
+++ src/usr.bin/make/parse.c Sat Oct 17 20:32:20 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.377 2020/10/17 19:10:07 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.378 2020/10/17 20:32:20 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.377 2020/10/17 19:10:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.378 2020/10/17 20:32:20 rillig Exp $");
/* types and constants */
@@ -2991,30 +2991,6 @@ Parse_File(const char *name, int fd)
}
}
-#ifndef POSIX
- /*
- * To make life easier on novices, if the line is indented we
- * first make sure the line has a dependency operator in it.
- * If it doesn't have an operator and we're in a dependency
- * line's script, we assume it's actually a shell command
- * and add it to the current list of targets.
- */
- cp = line;
- if (ch_isspace(line[0])) {
- pp_skip_whitespace(&cp);
- while (*cp && (ParseIsEscaped(line, cp) ||
- *cp != ':' && *cp != '!')) {
- cp++;
- }
- if (*cp == '\0') {
- if (targets == NULL) {
- Parse_Error(PARSE_WARNING,
- "Shell command needs a leading tab");
- goto shellCommand;
- }
- }
- }
-#endif
FinishDependencyGroup();
/*