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): reduce scope of local variables in App...



details:   https://anonhg.NetBSD.org/src/rev/8919e3fed785
branches:  trunk
changeset: 974405:8919e3fed785
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jul 31 13:39:15 2020 +0000

description:
make(1): reduce scope of local variables in ApplyModifier_Regex

diffstat:

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

diffs (54 lines):

diff -r 0b3e72cad0d7 -r 8919e3fed785 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Fri Jul 31 13:30:09 2020 +0000
+++ b/usr.bin/make/var.c        Fri Jul 31 13:39:15 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.360 2020/07/31 13:30:09 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.361 2020/07/31 13:39:15 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.360 2020/07/31 13:30:09 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.361 2020/07/31 13:39:15 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.360 2020/07/31 13:30:09 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.361 2020/07/31 13:39:15 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2463,10 +2463,6 @@
 static ApplyModifierResult
 ApplyModifier_Regex(const char *mod, ApplyModifiersState *st)
 {
-    ModifyWord_SubstRegexArgs args;
-
-    args.pflags = 0;
-    Boolean oneBigWord = st->oneBigWord;
     char delim = mod[1];
     if (delim == '\0') {
        Error("Missing delimiter for :C modifier");
@@ -2483,6 +2479,7 @@
        return AMR_CLEANUP;
     }
 
+    ModifyWord_SubstRegexArgs args;
     args.replace = ParseModifierPart(&st->next, delim, st->eflags, st->ctxt,
                                     NULL, NULL, NULL);
     if (args.replace == NULL) {
@@ -2491,6 +2488,8 @@
        return AMR_CLEANUP;
     }
 
+    args.pflags = 0;
+    Boolean oneBigWord = st->oneBigWord;
     for (;; st->next++) {
        switch (*st->next) {
        case 'g':



Home | Main Index | Thread Index | Old Index