Module Name: src Committed By: rillig Date: Tue Feb 23 00:11:07 UTC 2021
Modified Files: src/usr.bin/make: var.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.842 -r1.843 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.842 src/usr.bin/make/var.c:1.843 --- src/usr.bin/make/var.c:1.842 Tue Feb 23 00:04:48 2021 +++ src/usr.bin/make/var.c Tue Feb 23 00:11:07 2021 @@ -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 @@ ApplyModifier_Gmtime(const char **pp, Ap 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 @@ ApplyModifier_Localtime(const char **pp, 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;