Merge branch 'rs/strbuf-getcwd'
Reduce the use of fixed sized buffer passed to getcwd() calls by introducing xgetcwd() helper. * rs/strbuf-getcwd: use strbuf_add_absolute_path() to add absolute paths abspath: convert absolute_path() to strbuf use xgetcwd() to set $GIT_DIR use xgetcwd() to get the current directory or die wrapper: add xgetcwd() abspath: convert real_path_internal() to strbuf abspath: use strbuf_getcwd() to remember original working directory setup: convert setup_git_directory_gently_1 et al. to strbuf unix-sockets: use strbuf_getcwd() strbuf: add strbuf_getcwd()
This commit is contained in:
3
strbuf.h
3
strbuf.h
@ -174,6 +174,7 @@ extern size_t strbuf_fread(struct strbuf *, size_t, FILE *);
|
||||
extern ssize_t strbuf_read(struct strbuf *, int fd, size_t hint);
|
||||
extern int strbuf_read_file(struct strbuf *sb, const char *path, size_t hint);
|
||||
extern int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint);
|
||||
extern int strbuf_getcwd(struct strbuf *sb);
|
||||
|
||||
extern int strbuf_getwholeline(struct strbuf *, FILE *, int);
|
||||
extern int strbuf_getline(struct strbuf *, FILE *, int);
|
||||
@ -189,6 +190,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