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): remove redundant condition for regmatc...



details:   https://anonhg.NetBSD.org/src/rev/ad05c2ee9d7e
branches:  trunk
changeset: 945490:ad05c2ee9d7e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 31 12:22:43 2020 +0000

description:
make(1): remove redundant condition for regmatch_t.rm_eo being -1

If rm_so is -1, rm_eo is guaranteed to be -1 as well.

diffstat:

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

diffs (27 lines):

diff -r 804e1241aeab -r ad05c2ee9d7e usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sat Oct 31 12:20:36 2020 +0000
+++ b/usr.bin/make/var.c        Sat Oct 31 12:22:43 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.616 2020/10/31 11:54:33 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.617 2020/10/31 12:22:43 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -129,7 +129,7 @@
 #include    "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.616 2020/10/31 11:54:33 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.617 2020/10/31 12:22:43 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -1408,7 +1408,7 @@
 
                if (n >= args->nsub) {
                    Error("No subexpression \\%zu", n);
-               } else if (m[n].rm_so == -1 && m[n].rm_eo == -1) {
+               } else if (m[n].rm_so == -1) {
                    Error("No match for subexpression \\%zu", n);
                } else {
                    SepBuf_AddBytesBetween(buf, wp + m[n].rm_so,



Home | Main Index | Thread Index | Old Index