diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-03-18 14:00:15 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-18 14:00:15 -0700 |
commit | 6f0166771aadeb069b8952255414d67b643db1bf (patch) | |
tree | 2494ed3a3a79b40e2a31d5892b33504505425bd6 /path.c | |
parent | 34120a5fb555a24904a85e64554bdcc7bcc17963 (diff) | |
parent | 67beb600563cf28186f44450e528df1ec4d524fd (diff) | |
download | git-6f0166771aadeb069b8952255414d67b643db1bf.tar.gz |
Merge branch 'jk/config-path-include-fix' into maint
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) { |