summaryrefslogtreecommitdiff
path: root/src/config_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config_file.c')
-rw-r--r--src/config_file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/config_file.c b/src/config_file.c
index 1f3ebfca9..7ced1e5ba 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -983,9 +983,12 @@ static int write_section(git_filebuf *file, const char *key)
if (dot == NULL) {
git_buf_puts(&buf, key);
} else {
+ char *escaped;
git_buf_put(&buf, key, dot - key);
- /* TODO: escape */
- git_buf_printf(&buf, " \"%s\"", dot + 1);
+ escaped = escape_value(dot + 1);
+ GITERR_CHECK_ALLOC(escaped);
+ git_buf_printf(&buf, " \"%s\"", escaped);
+ git__free(escaped);
}
git_buf_puts(&buf, "]\n");