Module Name: src
Committed By: rillig
Date: Sun Jan 17 11:55:55 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: err.c
Log Message:
lint: rename local variables in lbasename
To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/xlint/lint1/err.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/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.67 src/usr.bin/xlint/lint1/err.c:1.68
--- src/usr.bin/xlint/lint1/err.c:1.67 Thu Jan 14 07:42:31 2021
+++ src/usr.bin/xlint/lint1/err.c Sun Jan 17 11:55:55 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: err.c,v 1.67 2021/01/14 07:42:31 rillig Exp $ */
+/* $NetBSD: err.c,v 1.68 2021/01/17 11:55:55 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.67 2021/01/14 07:42:31 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.68 2021/01/17 11:55:55 rillig Exp $");
#endif
#include <sys/types.h>
@@ -418,19 +418,19 @@ msglist(void)
static const char *
lbasename(const char *path)
{
- const char *cp, *cp1, *cp2;
+ const char *p, *base, *dir;
if (Fflag)
return path;
- cp = cp1 = cp2 = path;
- while (*cp != '\0') {
- if (*cp++ == '/') {
- cp2 = cp1;
- cp1 = cp;
+ p = base = dir = path;
+ while (*p != '\0') {
+ if (*p++ == '/') {
+ dir = base;
+ base = p;
}
}
- return *cp1 == '\0' ? cp2 : cp1;
+ return *base != '\0' ? base : dir;
}
static void