Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: 3.1.5-pws-12: getcwd



"Andrej Borsenkow" wrote:
> What is wrong with native getcwd? (Apart, that it may use native malloc() to
> allocate buffer)? If there are any known problems, is it possible to write a
> configure check for them?

The only problem I can see is that getcwd() is passed a fixed buffer size
which won't get reallocated if it's too small (the default is PATH_MAX
which should normally be enough), and there's no way to tell it to get as
much as it needs --- it always seems to use the size argument.  This could
be fixed by checking for an ERANGE and reallocating.  There's no record of
problems with real getcwd()s in the source, but I don't think it was used
at all till recently.  Currently configure doesn't even check for getcwd().
Does anyone know more?

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author