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): migrate Var_Parse to Var_ParsePP in ar...



details:   https://anonhg.NetBSD.org/src/rev/95069c06e062
branches:  trunk
changeset: 954629:95069c06e062
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Sep 07 06:51:05 2020 +0000

description:
make(1): migrate Var_Parse to Var_ParsePP in archive handling

diffstat:

 usr.bin/make/arch.c |  22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diffs (77 lines):

diff -r 18e73ffcfaa9 -r 95069c06e062 usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Mon Sep 07 06:44:53 2020 +0000
+++ b/usr.bin/make/arch.c       Mon Sep 07 06:51:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.109 2020/09/07 06:44:53 rillig Exp $        */
+/*     $NetBSD: arch.c,v 1.110 2020/09/07 06:51:05 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.109 2020/09/07 06:44:53 rillig Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.110 2020/09/07 06:51:05 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.109 2020/09/07 06:44:53 rillig Exp $");
+__RCSID("$NetBSD: arch.c,v 1.110 2020/09/07 06:51:05 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -233,20 +233,20 @@
             * Variable spec, so call the Var module to parse the puppy
             * so we can safely advance beyond it...
             */
-           int length;
+           const char *nested_p = cp;
            void *result_freeIt;
            const char *result;
            Boolean isError;
 
-           result = Var_Parse(cp, ctxt, VARE_UNDEFERR|VARE_WANTRES,
-                              &length, &result_freeIt);
+           result = Var_ParsePP(&nested_p, ctxt,
+                              VARE_UNDEFERR|VARE_WANTRES, &result_freeIt);
            isError = result == var_Error;
            free(result_freeIt);
            if (isError)
                return FALSE;
 
            subLibName = TRUE;
-           cp += length;
+           cp += nested_p - cp;
        } else
            cp++;
     }
@@ -275,13 +275,13 @@
                 * Variable spec, so call the Var module to parse the puppy
                 * so we can safely advance beyond it...
                 */
-               int     length;
                void    *freeIt;
                const char *result;
                Boolean isError;
+               const char *nested_p = cp;
 
-               result = Var_Parse(cp, ctxt, VARE_UNDEFERR|VARE_WANTRES,
-                                  &length, &freeIt);
+               result = Var_ParsePP(&nested_p, ctxt,
+                                    VARE_UNDEFERR|VARE_WANTRES, &freeIt);
                isError = result == var_Error;
                free(freeIt);
 
@@ -289,7 +289,7 @@
                    return FALSE;
 
                doSubst = TRUE;
-               cp += length;
+               cp += nested_p - cp;
            } else {
                cp++;
            }



Home | Main Index | Thread Index | Old Index