strbuf: add strbuf_getcwd()
commitf22a76e9110e8e31efa3781b1a3cf2b4565d9e8a
authorRené Scharfe <l.s.r@web.de>
Mon, 28 Jul 2014 18:24:29 +0000 (28 20:24 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Jul 2014 20:48:07 +0000 (28 13:48 -0700)
treead22c9025beca75ad94f43bede840ca46a529ba6
parentebc5da3208824e25a89672a3b91bd13629b215fe
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>
Documentation/technical/api-strbuf.txt
strbuf.c
strbuf.h