Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-10-01 17:44:06 +0300
committerJunio C Hamano <gitster@pobox.com>2017-10-02 07:13:41 +0300
commitfa2bb34477120f18d0834a545ac777e6295650d2 (patch)
tree0530f5a19e16c26bb648e5b65ffe059124e0a8cf /path.c
parentea220ee40cbb03a63ebad2be902057bf742492fd (diff)
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 <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'path.c')
-rw-r--r--path.c2
1 files changed, 1 insertions, 1 deletions
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