Re: [PATCH] strbuf: add strbuf_add_real_path()

2017-02-28 Thread Brandon Williams
On 02/27, René Scharfe wrote: > Am 27.02.2017 um 19:22 schrieb Brandon Williams: > >On 02/25, René Scharfe wrote: > >>+void strbuf_add_real_path(struct strbuf *sb, const char *path) > >>+{ > >>+ if (sb->len) { > >>+ struct strbuf resolved = STRBUF_INIT; > >>+

Re: [PATCH] strbuf: add strbuf_add_real_path()

2017-02-27 Thread René Scharfe
Am 27.02.2017 um 19:22 schrieb Brandon Williams: On 02/25, René Scharfe wrote: +void strbuf_add_real_path(struct strbuf *sb, const char *path) +{ + if (sb->len) { + struct strbuf resolved = STRBUF_INIT; + strbuf_realpath(, path, 1); +

Re: [PATCH] strbuf: add strbuf_add_real_path()

2017-02-27 Thread Brandon Williams
On 02/25, René Scharfe wrote: > Add a function for appending the canonized absolute pathname of a given > path to a strbuf. It keeps the existing contents intact, as expected of > a function of the strbuf_add() family, while avoiding copying the result > if the given strbuf is empty. It's more

[PATCH] strbuf: add strbuf_add_real_path()

2017-02-25 Thread René Scharfe
Add a function for appending the canonized absolute pathname of a given path to a strbuf. It keeps the existing contents intact, as expected of a function of the strbuf_add() family, while avoiding copying the result if the given strbuf is empty. It's more consistent with the rest of the strbuf