diff options
| author | rillig <rillig@NetBSD.org> | 2022-10-01 09:20:47 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2022-10-01 09:20:47 +0000 |
| commit | 859292fef32f7a06676e46feb4ccc5fcd245138f (patch) | |
| tree | f0a6efa19a4878b32e006fb3fb5127d205d14141 /usr.bin/make | |
| parent | 7b1f35c5b375e99ca5a6a407edfe55979d5e8806 (diff) | |
make: merge duplicate code
No functional change.
Diffstat (limited to 'usr.bin/make')
| -rw-r--r-- | usr.bin/make/var.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index 2c303a5cb52..d0543000ac0 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.1033 2022/09/27 17:46:58 rillig Exp $ */ +/* $NetBSD: var.c,v 1.1034 2022/10/01 09:20:47 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -139,7 +139,7 @@ #include "metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.1033 2022/09/27 17:46:58 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.1034 2022/10/01 09:20:47 rillig Exp $"); /* * Variables are defined using one of the VAR=value assignments. Their @@ -2926,11 +2926,8 @@ ApplyModifier_Regex(const char **pp, ModChain *ch) oneBigWord = ch->oneBigWord; ParsePatternFlags(pp, &args.pflags, &oneBigWord); - if (!ModChain_ShouldEval(ch)) { - LazyBuf_Done(&replaceBuf); - FStr_Done(&re); - return AMR_OK; - } + if (!ModChain_ShouldEval(ch)) + goto done; error = regcomp(&args.re, re.str, REG_EXTENDED); if (error != 0) { @@ -2947,6 +2944,7 @@ ApplyModifier_Regex(const char **pp, ModChain *ch) ModifyWords(ch, ModifyWord_SubstRegex, &args, oneBigWord); regfree(&args.re); +done: LazyBuf_Done(&replaceBuf); FStr_Done(&re); return AMR_OK; |
