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: move all labels in ModifyWord_SubstRegex ...



details:   https://anonhg.NetBSD.org/src/rev/3e4b94627227
branches:  trunk
changeset: 379837:3e4b94627227
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jun 21 17:52:33 2021 +0000

description:
make: move all labels in ModifyWord_SubstRegex to the same level

No functional change.

diffstat:

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

diffs (43 lines):

diff -r c6a0793fda03 -r 3e4b94627227 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Mon Jun 21 17:21:37 2021 +0000
+++ b/usr.bin/make/var.c        Mon Jun 21 17:52:33 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.935 2021/06/21 17:21:37 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.936 2021/06/21 17:52:33 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.935 2021/06/21 17:21:37 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.936 2021/06/21 17:52:33 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -1610,11 +1610,8 @@ ModifyWord_SubstRegex(Substring word, Se
 
        assert(word.end[0] == '\0');    /* assume null-terminated word */
        wp = word.start;
-       if (args->pflags.subOnce && args->matched) {
-       nosub:
-               SepBuf_AddStr(buf, wp);
-               return;
-       }
+       if (args->pflags.subOnce && args->matched)
+               goto no_match;
 
 again:
        xrv = regexec(&args->re, wp, args->nsub, m, flags);
@@ -1622,7 +1619,9 @@ again:
                goto ok;
        if (xrv != REG_NOMATCH)
                VarREError(xrv, &args->re, "Unexpected regex error");
-       goto nosub;
+no_match:
+       SepBuf_AddStr(buf, wp);
+       return;
 
 ok:
        args->matched = true;



Home | Main Index | Thread Index | Old Index