summaryrefslogtreecommitdiff
path: root/src/config_file.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@elego.de>2012-11-13 13:41:01 -0800
committerCarlos Martín Nieto <cmn@elego.de>2012-11-13 13:53:41 -0800
commit47db054df053fb09c8c92edaa0238af2a2605e65 (patch)
treeb7a61fc24c910b0604a3493323d9064111d816b0 /src/config_file.c
parent3ee078c0f7ed278be4839a6bde7dce29a614d336 (diff)
downloadlibgit2-47db054df053fb09c8c92edaa0238af2a2605e65.tar.gz
config: distinguish between a lone variable name and one without rhs
'[section] variable' and '[section] variable =' behave differently when parsed as booleans, so we need to store that distinction internally.
Diffstat (limited to 'src/config_file.c')
-rw-r--r--src/config_file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/config_file.c b/src/config_file.c
index 4ca842b89..4d9f99986 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -1432,8 +1432,10 @@ static int parse_variable(diskfile_backend *cfg, char **var_name, char **var_val
else if (value_start[0] != '\0') {
*var_value = fixup_line(value_start, 0);
GITERR_CHECK_ALLOC(*var_value);
+ } else { /* equals sign but missing rhs */
+ *var_value = git__strdup("");
+ GITERR_CHECK_ALLOC(*var_value);
}
-
}
git__free(line);