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): more descriptive variable names in Str...



details:   https://anonhg.NetBSD.org/src/rev/d477f9ade6f4
branches:  trunk
changeset: 936660:d477f9ade6f4
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 01 12:04:46 2020 +0000

description:
make(1): more descriptive variable names in Str_SYSVSubst

diffstat:

 usr.bin/make/var.c |  23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diffs (55 lines):

diff -r 9760c5a5de4e -r d477f9ade6f4 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sat Aug 01 12:04:00 2020 +0000
+++ b/usr.bin/make/var.c        Sat Aug 01 12:04:46 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.375 2020/08/01 09:25:36 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.376 2020/08/01 12:04:46 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.375 2020/08/01 09:25:36 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.376 2020/08/01 12:04:46 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.375 2020/08/01 09:25:36 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.376 2020/08/01 12:04:46 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1233,20 +1233,19 @@
  *-----------------------------------------------------------------------
  */
 static void
-Str_SYSVSubst(SepBuf *buf, const char *pat, const char *src, size_t len,
+Str_SYSVSubst(SepBuf *buf, const char *pat, const char *src, size_t src_len,
              Boolean lhsHasPercent)
 {
-    const char *m;
-
-    if ((m = strchr(pat, '%')) != NULL && lhsHasPercent) {
+    const char *percent = strchr(pat, '%');
+
+    if (percent != NULL && lhsHasPercent) {
        /* Copy the prefix */
-       SepBuf_AddBytesBetween(buf, pat, m);
-       /* skip the % */
-       pat = m + 1;
+       SepBuf_AddBytesBetween(buf, pat, percent);
+       pat = percent + 1;
     }
-    if (m != NULL || !lhsHasPercent) {
+    if (percent != NULL || !lhsHasPercent) {
        /* Copy the pattern */
-       SepBuf_AddBytes(buf, src, len);
+       SepBuf_AddBytes(buf, src, src_len);
     }
 
     /* append the rest */



Home | Main Index | Thread Index | Old Index