(xgetcwd): If the required pathname length is smaller
authorJim Meyering <jim@meyering.net>
Wed, 21 Jun 2000 20:16:03 +0000 (20:16 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 21 Jun 2000 20:16:03 +0000 (20:16 +0000)
commit4f796b144c85d69ea6a5037e95bc3aba0a073e1e
treee52b9b5d6c9373cf6e4e78b243849480f82f31d8
parent2c096e991c785604e8eed6f57bca67146c8e6f2f
(xgetcwd): If the required pathname length is smaller
than 1024, return a memory chunk of least possible size, instead
of size PATH_MAX + 2. In the loop, increment the size proportionally.
Use free/xmalloc instead of xrealloc to avoid copying for very long paths.
lib/xgetcwd.c