Skip to content

Commit fa2bb34

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ea220ee commit fa2bb34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

path.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ char *expand_user_path(const char *path, int real_home)
717717
if (!home)
718718
goto return_null;
719719
if (real_home)
720-
strbuf_addstr(&user_path, real_path(home));
720+
strbuf_add_real_path(&user_path, home);
721721
else
722722
strbuf_addstr(&user_path, home);
723723
#ifdef GIT_WINDOWS_NATIVE

0 commit comments

Comments
 (0)