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 unnecessary variable assignment



details:   https://anonhg.NetBSD.org/src/rev/bb1516bf6f5c
branches:  trunk
changeset: 1012355:bb1516bf6f5c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jul 27 22:21:29 2020 +0000

description:
make(1): remove unnecessary variable assignment

It is not the job of an ApplyModifier function to directly manipulate the
final result of the ApplyModifiers function.  In fact, the resulting
pointer was overwritten unconditionally, in such an obvious way that the
compiler could have detected this.  GCC 5 didn't though, which reduces
the code size a bit.

diffstat:

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

diffs (34 lines):

diff -r 2bdfad9a5d99 -r bb1516bf6f5c usr.bin/make/var.c
--- a/usr.bin/make/var.c        Mon Jul 27 22:02:26 2020 +0000
+++ b/usr.bin/make/var.c        Mon Jul 27 22:21:29 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.341 2020/07/27 22:02:26 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.342 2020/07/27 22:21:29 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.341 2020/07/27 22:02:26 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.342 2020/07/27 22:21:29 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.341 2020/07/27 22:02:26 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.342 2020/07/27 22:21:29 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2510,7 +2510,6 @@
     int error = regcomp(&args.re, re, REG_EXTENDED);
     free(re);
     if (error) {
-       *st->lengthPtr = st->cp - st->start + 1;
        VarREError(error, &args.re, "RE substitution error");
        free(args.replace);
        return FALSE;



Home | Main Index | Thread Index | Old Index