summaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-02-27 23:01:25 +0100
committerJunio C Hamano <gitster@pobox.com>2014-02-27 23:01:25 +0100
commitbfef492d769cbea25c3cd951fe452be85402b160 (patch)
tree24ef7ae95a661de168165b7927df4b2bf1ceba54 /config.c
parentMerge branch 'ds/rev-parse-required-args' (diff)
parenthandle_path_include: don't look at NULL value (diff)
downloadgit-bfef492d769cbea25c3cd951fe452be85402b160.tar.xz
git-bfef492d769cbea25c3cd951fe452be85402b160.zip
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 'config.c')
-rw-r--r--config.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/config.c b/config.c
index d969a5aefc..314d8ee740 100644
--- a/config.c
+++ b/config.c
@@ -84,8 +84,12 @@ static int handle_path_include(const char *path, struct config_include_data *inc
{
int ret = 0;
struct strbuf buf = STRBUF_INIT;
- char *expanded = expand_user_path(path);
+ char *expanded;
+ if (!path)
+ return config_error_nonbool("include.path");
+
+ expanded = expand_user_path(path);
if (!expanded)
return error("Could not expand include path '%s'", path);
path = expanded;