Module Name:    src
Committed By:   rillig
Date:           Sun Sep 13 21:12:08 UTC 2020

Modified Files:
        src/usr.bin/make: parse.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.304 -r1.305 src/usr.bin/make/parse.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/parse.c
diff -u src/usr.bin/make/parse.c:1.304 src/usr.bin/make/parse.c:1.305
--- src/usr.bin/make/parse.c:1.304	Sun Sep 13 18:27:39 2020
+++ src/usr.bin/make/parse.c	Sun Sep 13 21:12:08 2020
@@ -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 @@ ParseFindKeyword(const char *str)
 }
 
 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 @@ PrintLocation(FILE *f, const char *cfnam
 	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);
 }
 

Reply via email to