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): rename local variables in PrintLocation
details: https://anonhg.NetBSD.org/src/rev/b4571f39bd29
branches: trunk
changeset: 943954:b4571f39bd29
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Sep 13 21:12:08 2020 +0000
description:
make(1): rename local variables in PrintLocation
For PrintLocation, there is no "current" filename or line number,
therefore the "c" in the variable names was confusing.
diffstat:
usr.bin/make/parse.c | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diffs (59 lines):
diff -r 03a7d2a34cf9 -r b4571f39bd29 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c Sun Sep 13 21:03:14 2020 +0000
+++ b/usr.bin/make/parse.c Sun Sep 13 21:12:08 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.304 2020/09/13 18:27:39 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.305 2020/09/13 21:12:08 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.304 2020/09/13 18:27:39 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.305 2020/09/13 21:12:08 rillig Exp $");
/* types and constants */
@@ -601,14 +601,14 @@
}
static void
-PrintLocation(FILE *f, const char *cfname, size_t clineno)
+PrintLocation(FILE *f, const char *filename, size_t lineno)
{
char dirbuf[MAXPATHLEN+1];
- const char *dir, *fname;
- char *dir_freeIt, *fname_freeIt;
+ const char *dir, *base;
+ char *dir_freeIt, *base_freeIt;
- if (*cfname == '/' || strcmp(cfname, "(stdin)") == 0) {
- (void)fprintf(f, "\"%s\" line %zu: ", cfname, clineno);
+ if (*filename == '/' || strcmp(filename, "(stdin)") == 0) {
+ (void)fprintf(f, "\"%s\" line %zu: ", filename, lineno);
return;
}
@@ -621,14 +621,14 @@
if (*dir != '/')
dir = realpath(dir, dirbuf);
- fname = Var_Value(".PARSEFILE", VAR_GLOBAL, &fname_freeIt);
- if (fname == NULL) {
- const char *slash = strrchr(cfname, '/');
- fname = slash != NULL ? slash + 1 : cfname;
+ base = Var_Value(".PARSEFILE", VAR_GLOBAL, &base_freeIt);
+ if (base == NULL) {
+ const char *slash = strrchr(filename, '/');
+ base = slash != NULL ? slash + 1 : filename;
}
- (void)fprintf(f, "\"%s/%s\" line %zu: ", dir, fname, clineno);
- bmake_free(fname_freeIt);
+ (void)fprintf(f, "\"%s/%s\" line %zu: ", dir, base, lineno);
+ bmake_free(base_freeIt);
bmake_free(dir_freeIt);
}
Home |
Main Index |
Thread Index |
Old Index