diff options
| author | Simon J. Gerraty <sjg@FreeBSD.org> | 2026-07-05 18:22:31 +0000 |
|---|---|---|
| committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2026-07-05 18:22:31 +0000 |
| commit | e988c5eab5231646c612d35ff5b16122cebfbf6a (patch) | |
| tree | 307239878c1f97050623742f4663c68476e81e4f /parse.c | |
| parent | ef402bba84260816d3e8d6e2439b0bc7eddc9446 (diff) | |
Import bmake-20260704vendor/NetBSD/bmake/20260704vendor/NetBSD/bmake
Intersting/relevant changes since bmake-20260508
ChangeLog since bmake-20260508
2026-07-04 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20260704
2026-07-03 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20260703
Merge with NetBSD make, pick up
o meta.c: do a better job of resolving relative paths
o var.c: add alternation support to :M
eg. :M*{Makefile*,.mk} matches any *Makefile* or *.mk
2026-07-02 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20260702
Merge with NetBSD make, pick up
o meta.c: .MAKE.META.FILTER can be used to more generally filter
relevant content of .meta file in meta_oodate.
2026-06-19 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20260619
Merge with NetBSD make, pick up
o make.1: fix description of .MADE it is a source not a target.
* update mk files
2026-06-10 Simon J Gerraty <sjg@beast.crufty.net>
* VERSION (_MAKE_VERSION): 20260609
Merge with NetBSD make, pick up
o parse.c: allow semicolons and parentheses in dependency line
expressions
mk/ChangeLog since bmake-20260508
2026-07-04 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20260704
2026-07-03 Simon J Gerraty <sjg@beast.crufty.net>
* dirdeps.mk: make use of alternation support in latest bmake
when setting .MAKE.META.IGNORE_FILTER so we can get both
Makefile.depend* and *.mk to make cache out-of-date.
2026-07-02 Simon J Gerraty <sjg@beast.crufty.net>
* meta2deps.py: detect corrupted filemon data on Linux,
caused by lost newlines.
2026-06-21 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20260621
* gendirdeps.mk: more debug output
* meta.autodep.mk: remove extra } from GENDIRDEPS_ENV
2026-06-19 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20260619
* install-new.mk: for POSIX_SHELL we need .new*
rather than just .new
2026-05-21 Simon J Gerraty <sjg@beast.crufty.net>
* meta2deps.{py,sh}: skip pathnames with spaces - not worth the pain.
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 33 |
1 files changed, 17 insertions, 16 deletions
@@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.756 2026/04/06 17:13:55 rillig Exp $ */ +/* $NetBSD: parse.c,v 1.757 2026/06/09 08:27:08 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -110,7 +110,7 @@ #include "pathnames.h" /* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: parse.c,v 1.756 2026/04/06 17:13:55 rillig Exp $"); +MAKE_RCSID("$NetBSD: parse.c,v 1.757 2026/06/09 08:27:08 rillig Exp $"); /* Detects a multiple-inclusion guard in a makefile. */ typedef enum { @@ -2838,22 +2838,23 @@ Parse_GuardEndif(void) static char * FindSemicolon(char *p) { - int depth = 0; + if (strchr(p, ';') == NULL) + return NULL; - for (; *p != '\0'; p++) { - if (*p == '\\' && p[1] != '\0') { + while (*p != '\0') { + if (*p == ';') + return p; + if (*p == '$' && p[1] == '$') + p += 2; + else if (*p == '$') { + const char *cp = p; + FStr value = Var_Parse(&cp, SCOPE_GLOBAL, VARE_PARSE); + FStr_Done(&value); + p += cp - p; + } else p++; - continue; - } - - if (*p == '$' && (p[1] == '(' || p[1] == '{')) - depth++; - else if (depth > 0 && (*p == ')' || *p == '}')) - depth--; - else if (depth == 0 && *p == ';') - break; } - return p; + return NULL; } static void @@ -2864,7 +2865,7 @@ ParseDependencyLine(char *line) { char *semicolon = FindSemicolon(line); - if (*semicolon != '\0') { + if (semicolon != NULL) { /* Terminate the dependency list at the ';' */ *semicolon = '\0'; shellcmd = semicolon + 1; |
