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: fix local variable name for parsing argum...



details:   https://anonhg.NetBSD.org/src/rev/363beef31933
branches:  trunk
changeset: 959725:363beef31933
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Feb 23 00:11:07 2021 +0000

description:
make: fix local variable name for parsing arguments

The variable name 'arg' was misleading since after a successful
TryParseTime, it would no longer point to the argument of the variable
modifier, but to the _end_ of the argument.  To reduce confusion, use p
instead, like everywhere else.  This name is less specific, which is
still better than a wrong name.

diffstat:

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

diffs (52 lines):

diff -r ce3882468d0b -r 363beef31933 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Tue Feb 23 00:04:48 2021 +0000
+++ b/usr.bin/make/var.c        Tue Feb 23 00:11:07 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.842 2021/02/23 00:04:48 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.843 2021/02/23 00:11:07 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.842 2021/02/23 00:04:48 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.843 2021/02/23 00:11:07 rillig Exp $");
 
 typedef enum VarFlags {
        VFL_NONE        = 0,
@@ -2538,13 +2538,13 @@
                return AMR_UNKNOWN;
 
        if (mod[6] == '=') {
-               const char *arg = mod + 7;
-               if (!TryParseTime(&arg, &utc)) {
+               const char *p = mod + 7;
+               if (!TryParseTime(&p, &utc)) {
                        Parse_Error(PARSE_FATAL,
                            "Invalid time value: %s", mod + 7);
                        return AMR_CLEANUP;
                }
-               *pp = arg;
+               *pp = p;
        } else {
                utc = 0;
                *pp = mod + 6;
@@ -2565,13 +2565,13 @@
                return AMR_UNKNOWN;
 
        if (mod[9] == '=') {
-               const char *arg = mod + 10;
-               if (!TryParseTime(&arg, &utc)) {
+               const char *p = mod + 10;
+               if (!TryParseTime(&p, &utc)) {
                        Parse_Error(PARSE_FATAL,
                            "Invalid time value: %s", mod + 10);
                        return AMR_CLEANUP;
                }
-               *pp = arg;
+               *pp = p;
        } else {
                utc = 0;
                *pp = mod + 9;



Home | Main Index | Thread Index | Old Index