Module Name: src Committed By: rillig Date: Sun Nov 29 15:14:33 UTC 2020
Modified Files: src/usr.bin/make: dir.c Log Message: make(1): remove wrong comment in Dir_InitCur In a makefile with repeated ".CURDIR=." lines, Dir_AddDir is called with a NULL path, once per line. Since the path is NULL, the search for OpenDirs_Find is skipped and the directory is always read from disk. The freshly read directory has a refCount of 1, and the refCount never raises above 2. In Dir_InitCur, the directory of the previous .CURDIR has a refCount of 2, which is decremented twice and then freed. After this, the new directory is placed in the global 'cur', after incrementing its refCount to 2. It still seems wrong that the refCount of 'cur' is 2 instead of 1, but it works well. To generate a diff of this commit: cvs rdiff -u -r1.236 -r1.237 src/usr.bin/make/dir.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.