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/b6ee3482b8e7
branches:  trunk
changeset: 936288:b6ee3482b8e7
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 83ae6672a60a -r b6ee3482b8e7 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