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/da01ccc008b5
branches:  trunk
changeset: 977702:da01ccc008b5
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 fb4df35a7764 -r da01ccc008b5 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