abspath: convert absolute_path() to strbuf

Move most of the code of absolute_path() into the new function
strbuf_add_absolute_path() and in the process transform it to use
struct strbuf and xgetcwd() instead of a PATH_MAX-sized buffer,
which can be too small on some file systems.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe
2014-07-28 20:33:55 +02:00
committed by Junio C Hamano
parent 4d3ab44d26
commit 679eebe24d
4 changed files with 37 additions and 42 deletions

View File

@ -293,6 +293,12 @@ same behaviour as well.
Set the buffer to the path of the current working directory.
`strbuf_add_absolute_path`
Add a path to a buffer, converting a relative path to an
absolute one in the process. Symbolic links are not
resolved.
`stripspace`::
Strip whitespace from a buffer. The second parameter controls if