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): document difference between 'cur' and ...



details:   https://anonhg.NetBSD.org/src/rev/6ac3818ccd71
branches:  trunk
changeset: 957503:6ac3818ccd71
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Nov 30 20:17:00 2020 +0000

description:
make(1): document difference between 'cur' and 'dot'

diffstat:

 usr.bin/make/dir.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (40 lines):

diff -r ebbf229b81d7 -r 6ac3818ccd71 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Mon Nov 30 20:12:29 2020 +0000
+++ b/usr.bin/make/dir.c        Mon Nov 30 20:17:00 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.243 2020/11/30 18:49:58 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.244 2020/11/30 20:17:00 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -136,7 +136,7 @@
 #include "job.h"
 
 /*     "@(#)dir.c      8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: dir.c,v 1.243 2020/11/30 18:49:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.244 2020/11/30 20:17:00 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -267,8 +267,10 @@
 static int nearmisses;         /* Found under search path */
 static int bigmisses;          /* Sought by itself */
 
-static CachedDir *dot = NULL;  /* contents of current directory */
-static CachedDir *cur = NULL;  /* contents of current directory, if not dot */
+/* The cached contents of ".", the relative current directory. */
+static CachedDir *dot = NULL;
+/* The cached contents of the absolute current directory. */
+static CachedDir *cur = NULL;
 /* A fake path entry indicating we need to look for '.' last. */
 static CachedDir *dotLast = NULL;
 
@@ -1067,7 +1069,7 @@
         * Find the final component of the name and note whether it has a
         * slash in it (the name, I mean)
         */
-       base = strrchr(name, '/');
+       base = strrchr(name, '/'); /* XXX: confusing variable name */
        if (base != NULL) {
                hasSlash = TRUE;
                base++;



Home | Main Index | Thread Index | Old Index