From: René Scharfe Date: Sun, 1 Oct 2017 14:44:06 +0000 (+0200) Subject: path: use strbuf_add_real_path() X-Git-Tag: v2.15.0-rc0~7^2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/fa2bb34477120f18d0834a545ac777e6295650d2?ds=inline;hp=--cc path: use strbuf_add_real_path() Avoid a string copy to a static buffer by using strbuf_add_real_path() instead of combining strbuf_addstr() and real_path(). Patch generated by Coccinelle and contrib/coccinelle/strbuf.cocci. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- fa2bb34477120f18d0834a545ac777e6295650d2 diff --git a/path.c b/path.c index b533ec938d..bf096c411c 100644 --- a/path.c +++ b/path.c @@ -717,7 +717,7 @@ char *expand_user_path(const char *path, int real_home) if (!home) goto return_null; if (real_home) - strbuf_addstr(&user_path, real_path(home)); + strbuf_add_real_path(&user_path, home); else strbuf_addstr(&user_path, home); #ifdef GIT_WINDOWS_NATIVE