In getcwd.c I find the following comment:

In GNU, if BUF is NULL, an array is allocated with 'malloc'; the array is
> SIZE bytes long, unless SIZE == 0, in which case it is as big as necessary.
>

However, as far as I can see from the code, it always allocates if BUF is
NULL.

I assume this is the behaviour, as even getcwd-lgpl guarantees this GNU
behaviour!

I'm asking because I'd like to use gnulib getcwd to get the GNU behaviour
on non-GNU systems, and since my code is GPL'ed I'd like the "full fat"
gnulib getcwd.

-- 
https://rrt.sc3d.org

Reply via email to