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: clean up access to character iterator
details: https://anonhg.NetBSD.org/src/rev/79a731a5e0d5
branches: trunk
changeset: 1021789:79a731a5e0d5
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Jun 18 12:54:17 2021 +0000
description:
make: clean up access to character iterator
Having both p[0] and *p intermixed was inconsistent.
No functional change.
diffstat:
usr.bin/make/main.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diffs (42 lines):
diff -r 226461af23cf -r 79a731a5e0d5 usr.bin/make/main.c
--- a/usr.bin/make/main.c Fri Jun 18 10:57:14 2021 +0000
+++ b/usr.bin/make/main.c Fri Jun 18 12:54:17 2021 +0000
@@ -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 @@
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;
Home |
Main Index |
Thread Index |
Old Index