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 range restriction



details:   https://anonhg.NetBSD.org/src/rev/12c1013a7f67
branches:  trunk
changeset: 937710:12c1013a7f67
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Aug 23 22:49:45 2020 +0000

description:
make(1): remove redundant range restriction

re.re_nsub is at least 0, and (at least 0) + 1 cannot be 0.

diffstat:

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

diffs (35 lines):

diff -r 803bf95f2827 -r 12c1013a7f67 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sun Aug 23 22:34:29 2020 +0000
+++ b/usr.bin/make/var.c        Sun Aug 23 22:49:45 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.468 2020/08/23 22:13:38 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.469 2020/08/23 22:49:45 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.468 2020/08/23 22:13:38 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.469 2020/08/23 22:49:45 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.468 2020/08/23 22:13:38 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.469 2020/08/23 22:49:45 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2473,8 +2473,6 @@
     }
 
     args.nsub = args.re.re_nsub + 1;
-    if (args.nsub < 1)
-       args.nsub = 1;
     if (args.nsub > 10)
        args.nsub = 10;
     st->newVal = ModifyWords(st->ctxt, st->sep, oneBigWord, st->val,



Home | Main Index | Thread Index | Old Index