strbuf: add strbuf_getcwd()
Add strbuf_getcwd(), which puts the current working directory into a strbuf. Because it doesn't use a fixed-size buffer it supports arbitrarily long paths, provided the platform's getcwd() does as well. At least on Linux and FreeBSD it handles paths longer than PATH_MAX just fine. Suggested-by: Karsten Blees <karsten.blees@gmail.com> Helped-by: Duy Nguyen <pclouds@gmail.com> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
ebc5da3208
commit
f22a76e911
@ -289,6 +289,10 @@ same behaviour as well.
|
||||
use it unless you need the correct position in the file
|
||||
descriptor.
|
||||
|
||||
`strbuf_getcwd`::
|
||||
|
||||
Set the buffer to the path of the current working directory.
|
||||
|
||||
`stripspace`::
|
||||
|
||||
Strip whitespace from a buffer. The second parameter controls if
|
||||
|
||||
Reference in New Issue
Block a user