diff options
Diffstat (limited to 'strbuf.h')
-rw-r--r-- | strbuf.h | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -109,9 +109,7 @@ extern void strbuf_attach(struct strbuf *, void *, size_t, size_t); */ static inline void strbuf_swap(struct strbuf *a, struct strbuf *b) { - struct strbuf tmp = *a; - *a = *b; - *b = tmp; + SWAP(*a, *b); } @@ -443,6 +441,14 @@ extern int strbuf_getcwd(struct strbuf *sb); */ extern void strbuf_add_absolute_path(struct strbuf *sb, const char *path); + +/** + * Normalize in-place the path contained in the strbuf. See + * normalize_path_copy() for details. If an error occurs, the contents of "sb" + * are left untouched, and -1 is returned. + */ +extern int strbuf_normalize_path(struct strbuf *sb); + /** * Strip whitespace from a buffer. The second parameter controls if * comments are considered contents to be removed or not. |