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): remove unnecessary cp-- from Arch_Pars...



details:   https://anonhg.NetBSD.org/src/rev/7b7820850ace
branches:  trunk
changeset: 975852:7b7820850ace
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Sep 07 06:44:53 2020 +0000

description:
make(1): remove unnecessary cp-- from Arch_ParseArchive

diffstat:

 usr.bin/make/arch.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (58 lines):

diff -r f5357c8c9855 -r 7b7820850ace usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Mon Sep 07 06:33:05 2020 +0000
+++ b/usr.bin/make/arch.c       Mon Sep 07 06:44:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.108 2020/09/05 13:55:08 rillig Exp $        */
+/*     $NetBSD: arch.c,v 1.109 2020/09/07 06:44:53 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.108 2020/09/05 13:55:08 rillig Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.109 2020/09/07 06:44:53 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)arch.c     8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: arch.c,v 1.108 2020/09/05 13:55:08 rillig Exp $");
+__RCSID("$NetBSD: arch.c,v 1.109 2020/09/07 06:44:53 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -227,15 +227,15 @@
 
     subLibName = FALSE;
 
-    for (cp = libName; *cp != '(' && *cp != '\0'; cp++) {
+    for (cp = libName; *cp != '(' && *cp != '\0';) {
        if (*cp == '$') {
            /*
             * Variable spec, so call the Var module to parse the puppy
             * so we can safely advance beyond it...
             */
-           int         length;
-           void        *result_freeIt;
-           const char  *result;
+           int length;
+           void *result_freeIt;
+           const char *result;
            Boolean isError;
 
            result = Var_Parse(cp, ctxt, VARE_UNDEFERR|VARE_WANTRES,
@@ -246,8 +246,9 @@
                return FALSE;
 
            subLibName = TRUE;
-           cp += length - 1;
-       }
+           cp += length;
+       } else
+           cp++;
     }
 
     *cp++ = '\0';



Home | Main Index | Thread Index | Old Index