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:

committed by
Junio C Hamano

parent
4d3ab44d26
commit
679eebe24d
2
strbuf.h
2
strbuf.h
@ -179,6 +179,8 @@ extern void strbuf_addstr_urlencode(struct strbuf *, const char *,
|
||||
int reserved);
|
||||
extern void strbuf_humanise_bytes(struct strbuf *buf, off_t bytes);
|
||||
|
||||
extern void strbuf_add_absolute_path(struct strbuf *sb, const char *path);
|
||||
|
||||
__attribute__((format (printf,1,2)))
|
||||
extern int printf_ln(const char *fmt, ...);
|
||||
__attribute__((format (printf,2,3)))
|
||||
|
Reference in New Issue
Block a user