Hello,
make(1) has a guard in shortened_curdir() so
Buf_Init() should only happen once. I think this is
desirable because Buf_Init() malloc's space and old storage
pointers could be overwritten.
The guard doesn't work as intended because 'first'
is always true.
- Michael
Index: job.c
===================================================================
RCS file: /cvs/src/usr.bin/make/job.c,v
retrieving revision 1.139
diff -u -p -u -r1.139 job.c
--- job.c 21 Jan 2017 12:35:40 -0000 1.139
+++ job.c 19 Dec 2017 08:02:28 -0000
@@ -220,7 +220,7 @@ static const char *
shortened_curdir(void)
{
static BUFFER buf;
- bool first = true;
+ static bool first = true;
if (first) {
Buf_Init(&buf, 0);
buf_addcurdir(&buf);