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): make condition in ModifyWord_SubstRege...



details:   https://anonhg.NetBSD.org/src/rev/2617768be90e
branches:  trunk
changeset: 1012157:2617768be90e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Jul 24 08:20:24 2020 +0000

description:
make(1): make condition in ModifyWord_SubstRegex simpler

The generated code is still the same, at least with Clang.

diffstat:

 usr.bin/make/var.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (36 lines):

diff -r edc92862c107 -r 2617768be90e usr.bin/make/var.c
--- a/usr.bin/make/var.c        Fri Jul 24 08:12:43 2020 +0000
+++ b/usr.bin/make/var.c        Fri Jul 24 08:20:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.305 2020/07/24 08:12:43 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.306 2020/07/24 08:20:24 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.305 2020/07/24 08:12:43 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.306 2020/07/24 08:20:24 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.305 2020/07/24 08:12:43 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.306 2020/07/24 08:20:24 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1392,8 +1392,7 @@
     int flags = 0;
     regmatch_t m[10];
 
-    if ((args->pflags & (VARP_SUB_ONE | VARP_SUB_MATCHED)) ==
-       (VARP_SUB_ONE | VARP_SUB_MATCHED))
+    if ((args->pflags & VARP_SUB_ONE) && (args->pflags & VARP_SUB_MATCHED))
        xrv = REG_NOMATCH;
     else {
     tryagain:



Home | Main Index | Thread Index | Old Index