summaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-22 10:59:36 -0700
committerJunio C Hamano <gitster@pobox.com>2014-07-22 10:59:37 -0700
commit12621cb22224d1c2f507a643a578e386ee891c5c (patch)
treed0ab888b37baa09db9c7ef74840b739ff3cafb09 /path.c
parent4328190a81ea5aef679774322c7f9faf06b453af (diff)
parent1cefa143250ad8c60e2a3db6c18278f7bed508f5 (diff)
downloadgit-12621cb22224d1c2f507a643a578e386ee891c5c.tar.gz
Merge branch 'rs/code-cleaning'
* rs/code-cleaning: remote-testsvn: use internal argv_array of struct child_process in cmd_import() bundle: use internal argv_array of struct child_process in create_bundle() fast-import: use hashcmp() for SHA1 hash comparison transport: simplify fetch_objs_via_rsync() using argv_array run-command: use internal argv_array of struct child_process in run_hook_ve() use commit_list_count() to count the members of commit_lists strbuf: use strbuf_addstr() for adding C strings
Diffstat (limited to 'path.c')
-rw-r--r--path.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/path.c b/path.c
index 25c3b8ba7e..3afcdb432a 100644
--- a/path.c
+++ b/path.c
@@ -275,16 +275,16 @@ char *expand_user_path(const char *path)
const char *home = getenv("HOME");
if (!home)
goto return_null;
- strbuf_add(&user_path, home, strlen(home));
+ strbuf_addstr(&user_path, home);
} else {
struct passwd *pw = getpw_str(username, username_len);
if (!pw)
goto return_null;
- strbuf_add(&user_path, pw->pw_dir, strlen(pw->pw_dir));
+ strbuf_addstr(&user_path, pw->pw_dir);
}
to_copy = first_slash;
}
- strbuf_add(&user_path, to_copy, strlen(to_copy));
+ strbuf_addstr(&user_path, to_copy);
return strbuf_detach(&user_path, NULL);
return_null:
strbuf_release(&user_path);