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(1): don't use st->next as a local variable



details:   https://anonhg.NetBSD.org/src/rev/8c060aee6589
branches:  trunk
changeset: 936761:8c060aee6589
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Aug 03 14:42:50 2020 +0000

description:
make(1): don't use st->next as a local variable

diffstat:

 usr.bin/make/var.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (54 lines):

diff -r 59149646a491 -r 8c060aee6589 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Mon Aug 03 14:00:41 2020 +0000
+++ b/usr.bin/make/var.c        Mon Aug 03 14:42:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.407 2020/08/02 20:13:05 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.408 2020/08/03 14:42:50 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.407 2020/08/02 20:13:05 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.408 2020/08/03 14:42:50 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.407 2020/08/02 20:13:05 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.408 2020/08/03 14:42:50 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2804,20 +2804,20 @@
      * to verify it is a SYSV-make-style translation:
      * it must be: <string1>=<string2>)
      */
-    st->next = mod;
     int nest = 1;
-    while (*st->next != '\0' && nest > 0) {
-       if (*st->next == '=') {
+    const char *next = mod;
+    while (*next != '\0' && nest > 0) {
+       if (*next == '=') {
            eqFound = TRUE;
            /* continue looking for st->endc */
-       } else if (*st->next == st->endc)
+       } else if (*next == st->endc)
            nest--;
-       else if (*st->next == st->startc)
+       else if (*next == st->startc)
            nest++;
        if (nest > 0)
-           st->next++;
+           (next)++;
     }
-    if (*st->next != st->endc || !eqFound)
+    if (*next != st->endc || !eqFound)
        return AMR_UNKNOWN;
 
     char delim = '=';



Home | Main Index | Thread Index | Old Index