Mon Jul 27 22:21:29 2020 UTC ()
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.


(rillig)
diff -r1.341 -r1.342 src/usr.bin/make/var.c

cvs diff -r1.341 -r1.342 src/usr.bin/make/var.c (expand / switch to context diff)
--- src/usr.bin/make/var.c 2020/07/27 22:02:26 1.341
+++ src/usr.bin/make/var.c 2020/07/27 22:21:29 1.342
@@ -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;