summaryrefslogtreecommitdiff
path: root/usr.bin/make/parse.c
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2020-09-08 05:26:21 +0000
committerrillig <rillig@NetBSD.org>2020-09-08 05:26:21 +0000
commit9957c6c4e179dfd762b0c5287d71ec541ae08d8d (patch)
tree6d7a8c943497130e9ad84e8cd46a4c3971f6170f /usr.bin/make/parse.c
parent24fabd450d8cf1a005e2179ccc124cd291d34839 (diff)
make(1): fix off-by-one error in SuffExpandChildren
In suff.c r1.144 from yesterday, in the line "cp += nested_p - cp", I accidentally removed the "- 1". Since these "- 1" lines lead to slow execution, each branch now increments the pointer separately by the actually needed amount. Fixing this bug posed way more new questions than it answered, and it revealed an inconsistency in the parser about how characters are to be escaped, and missing details in the documentation of Var_Parse, as well as a parse error that unexpectedly doesn't stop make from continuing.
Diffstat (limited to 'usr.bin/make/parse.c')
-rw-r--r--usr.bin/make/parse.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index f0e236fb3f6..17de652d99d 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.288 2020/09/07 18:37:09 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.289 2020/09/08 05:26:21 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.288 2020/09/07 18:37:09 rillig Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.289 2020/09/08 05:26:21 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: parse.c,v 1.288 2020/09/07 18:37:09 rillig Exp $");
+__RCSID("$NetBSD: parse.c,v 1.289 2020/09/08 05:26:21 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -708,17 +708,10 @@ ParseErrorInternal(const char *cfname, size_t clineno, int type,
}
}
-/*-
- * Parse_Error --
- * External interface to ParseErrorInternal; uses the default filename
- * Line number.
- *
- * Results:
- * None
+/* External interface to ParseErrorInternal; uses the default filename and
+ * line number.
*
- * Side Effects:
- * None
- */
+ * Fmt is given without a trailing newline. */
/* VARARGS */
void
Parse_Error(int type, const char *fmt, ...)