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: eliminate common subexpression in ApplyMo...



details:   https://anonhg.NetBSD.org/src/rev/4c2a8f339aa8
branches:  trunk
changeset: 953631:4c2a8f339aa8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Mar 14 17:38:24 2021 +0000

description:
make: eliminate common subexpression in ApplyModifier_Remember

No functional change.

diffstat:

 usr.bin/make/var.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r cee300a8d50f -r 4c2a8f339aa8 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sun Mar 14 17:34:50 2021 +0000
+++ b/usr.bin/make/var.c        Sun Mar 14 17:38:24 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.868 2021/03/14 17:34:50 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.869 2021/03/14 17:38:24 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.868 2021/03/14 17:34:50 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.869 2021/03/14 17:38:24 rillig Exp $");
 
 typedef enum VarFlags {
        VFL_NONE        = 0,
@@ -3430,9 +3430,10 @@
                 * behavior defined in ParseModifierPart.  This creates an
                 * unnecessary, undocumented inconsistency in make.
                 */
-               size_t n = strcspn(mod + 2, ":)}");
-               *pp = mod + 2 + n;
-               name = FStr_InitOwn(bmake_strldup(mod + 2, n));
+               const char *arg = mod + 2;
+               size_t argLen = strcspn(arg, ":)}");
+               *pp = arg + argLen;
+               name = FStr_InitOwn(bmake_strldup(arg, argLen));
        } else
                *pp = mod + 1;
 



Home | Main Index | Thread Index | Old Index