Module Name: src Committed By: rillig Date: Sun Mar 14 15:22:21 UTC 2021
Modified Files: src/usr.bin/make: var.c Log Message: make: separate parsing and evaluating for modifier ':u' No functional change. To generate a diff of this commit: cvs rdiff -u -r1.861 -r1.862 src/usr.bin/make/var.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/var.c diff -u src/usr.bin/make/var.c:1.861 src/usr.bin/make/var.c:1.862 --- src/usr.bin/make/var.c:1.861 Sun Mar 14 15:19:15 2021 +++ src/usr.bin/make/var.c Sun Mar 14 15:22:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.861 2021/03/14 15:19:15 rillig Exp $ */ +/* $NetBSD: var.c,v 1.862 2021/03/14 15:22:21 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.861 2021/03/14 15:19:15 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.862 2021/03/14 15:22:21 rillig Exp $"); typedef enum VarFlags { VFL_NONE = 0, @@ -3329,8 +3329,8 @@ ApplyModifier_Assign(const char **pp, Ap if ((op[0] == '!' || op[0] == '+' || op[0] == '?') && op[1] == '=') goto ok; return AMR_UNKNOWN; /* "::<unrecognised>" */ -ok: +ok: if (expr->var->name.str[0] == '\0') { *pp = mod + 1; return AMR_BAD; @@ -3442,12 +3442,13 @@ ApplyModifier_WordFunc(const char **pp, static ApplyModifierResult ApplyModifier_Unique(const char **pp, ApplyModifiersState *st) { - if (IsDelimiter((*pp)[1], st)) { - Expr_SetValueOwn(st->expr, VarUniq(st->expr->value.str)); - (*pp)++; - return AMR_OK; - } else + if (!IsDelimiter((*pp)[1], st)) return AMR_UNKNOWN; + (*pp)++; + + Expr_SetValueOwn(st->expr, VarUniq(st->expr->value.str)); + + return AMR_OK; } #ifdef SYSVVARSUB