Module Name: src
Committed By: rillig
Date: Fri Jun 18 12:54:17 UTC 2021
Modified Files:
src/usr.bin/make: main.c
Log Message:
make: clean up access to character iterator
Having both p[0] and *p intermixed was inconsistent.
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.539 -r1.540 src/usr.bin/make/main.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/main.c
diff -u src/usr.bin/make/main.c:1.539 src/usr.bin/make/main.c:1.540
--- src/usr.bin/make/main.c:1.539 Mon Apr 19 16:35:11 2021
+++ src/usr.bin/make/main.c Fri Jun 18 12:54:17 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.539 2021/04/19 16:35:11 rillig Exp $ */
+/* $NetBSD: main.c,v 1.540 2021/06/18 12:54:17 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
#include "trace.h"
/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.539 2021/04/19 16:35:11 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.540 2021/06/18 12:54:17 rillig Exp $");
#if defined(MAKE_NATIVE) && !defined(lint)
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
"The Regents of the University of California. "
@@ -349,16 +349,16 @@ debug_setbuf:
static bool
IsRelativePath(const char *path)
{
- const char *cp;
+ const char *p;
if (path[0] != '/')
return true;
- cp = path;
- while ((cp = strstr(cp, "/.")) != NULL) {
- cp += 2;
- if (*cp == '.')
- cp++;
- if (cp[0] == '/' || cp[0] == '\0')
+ p = path;
+ while ((p = strstr(p, "/.")) != NULL) {
+ p += 2;
+ if (*p == '.')
+ p++;
+ if (*p == '/' || *p == '\0')
return true;
}
return false;