summaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-02-27 22:01:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-02-27 22:01:25 (GMT)
commitbfef492d769cbea25c3cd951fe452be85402b160 (patch)
tree24ef7ae95a661de168165b7927df4b2bf1ceba54 /path.c
parent28006fb046ddeaf15f8fe9c7cf2a122e2091451b (diff)
parent67beb600563cf28186f44450e528df1ec4d524fd (diff)
downloadgit-bfef492d769cbea25c3cd951fe452be85402b160.zip
git-bfef492d769cbea25c3cd951fe452be85402b160.tar.gz
git-bfef492d769cbea25c3cd951fe452be85402b160.tar.bz2
Merge branch 'jk/config-path-include-fix'
include.path variable (or any variable that expects a path that can use ~username expansion) in the configuration file is not a boolean, but the code failed to check it. * jk/config-path-include-fix: handle_path_include: don't look at NULL value expand_user_path: do not look at NULL path
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 24594c4..f9c5062 100644
--- a/path.c
+++ b/path.c
@@ -265,12 +265,12 @@ static struct passwd *getpw_str(const char *username, size_t len)
char *expand_user_path(const char *path)
{
struct strbuf user_path = STRBUF_INIT;
- const char *first_slash = strchrnul(path, '/');
const char *to_copy = path;
if (path == NULL)
goto return_null;
if (path[0] == '~') {
+ const char *first_slash = strchrnul(path, '/');
const char *username = path + 1;
size_t username_len = first_slash - username;
if (username_len == 0) {