Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make: note inconsistent parsing behavior in mod...



details:   https://anonhg.NetBSD.org/src/rev/94816dc5e17b
branches:  trunk
changeset: 1018998:94816dc5e17b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Feb 23 14:21:45 2021 +0000

description:
make: note inconsistent parsing behavior in modifier ':_='

diffstat:

 usr.bin/make/var.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r ad83df924e68 -r 94816dc5e17b usr.bin/make/var.c
--- a/usr.bin/make/var.c        Tue Feb 23 14:17:21 2021 +0000
+++ b/usr.bin/make/var.c        Tue Feb 23 14:21:45 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.846 2021/02/23 00:27:47 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.847 2021/02/23 14:21:45 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.846 2021/02/23 00:27:47 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.847 2021/02/23 14:21:45 rillig Exp $");
 
 typedef enum VarFlags {
        VFL_NONE        = 0,
@@ -3398,6 +3398,11 @@
                return AMR_UNKNOWN;
 
        if (mod[1] == '=') {
+               /*
+                * XXX: This ad-hoc call to strcspn deviates from the usual
+                * behavior defined in ParseModifierPart.  This creates an
+                * unnecessary, undocumented inconsistency in make.
+                */
                size_t n = strcspn(mod + 2, ":)}");
                char *name = bmake_strldup(mod + 2, n);
                Var_SetExpand(expr->scope, name, expr->value.str);



Home | Main Index | Thread Index | Old Index