mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-02-07 14:56:06 +00:00
(read_dirstream): Fix braino: fill in the buffer when not reallocating it!
This commit is contained in:
parent
737e056a89
commit
5df0d41985
1 changed files with 7 additions and 7 deletions
14
dir.c
14
dir.c
|
@ -616,14 +616,14 @@ read_dirstream (stream)
|
||||||
if (sizeof *d - sizeof d->d_name + len > bufsz)
|
if (sizeof *d - sizeof d->d_name + len > bufsz)
|
||||||
bufsz = sizeof *d - sizeof d->d_name + len;
|
bufsz = sizeof *d - sizeof d->d_name + len;
|
||||||
buf = xmalloc (bufsz);
|
buf = xmalloc (bufsz);
|
||||||
d = (struct dirent *) buf;
|
|
||||||
d->d_ino = 1;
|
|
||||||
#ifdef HAVE_D_NAMLEN
|
|
||||||
d->d_namlen = len - 1;
|
|
||||||
#endif
|
|
||||||
memcpy (d->d_name, df->name, len);
|
|
||||||
return d;
|
|
||||||
}
|
}
|
||||||
|
d = (struct dirent *) buf;
|
||||||
|
FAKE_DIR_ENTRY (d);
|
||||||
|
#ifdef HAVE_D_NAMLEN
|
||||||
|
d->d_namlen = len - 1;
|
||||||
|
#endif
|
||||||
|
memcpy (d->d_name, df->name, len);
|
||||||
|
return d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (++ds->bucket == DIRFILE_BUCKETS)
|
if (++ds->bucket == DIRFILE_BUCKETS)
|
||||||
|
|
Loading…
Reference in a new issue