summaryrefslogtreecommitdiff
path: root/combine-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-12-26 17:13:36 -0800
committerJunio C Hamano <gitster@pobox.com>2007-12-26 17:13:36 -0800
commitd56250911f4ec074048f4edb34551eaf384172cc (patch)
tree8978a2314f00add8f84a9164ba69da2fb70c9aeb /combine-diff.c
parent462a15bc82e6adbcb8db5fcc4791ec70a026aa4b (diff)
downloadgit-d56250911f4ec074048f4edb34551eaf384172cc.tar.gz
Fix rewrite_diff() name quoting.
This moves the logic to quote two paths (prefix + path) in C-style introduced in the previous commit from the dump_quoted_path() in combine-diff.c to quote.c, and uses it to fix rewrite_diff() that never C-quoted the pathnames correctly. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'combine-diff.c')
-rw-r--r--combine-diff.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/combine-diff.c b/combine-diff.c
index 7d710334ff..0e19cbaacc 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -656,16 +656,7 @@ static void dump_quoted_path(const char *head,
strbuf_reset(&buf);
strbuf_addstr(&buf, c_meta);
strbuf_addstr(&buf, head);
- if (quote_c_style(prefix, NULL, NULL, 0) ||
- quote_c_style(path, NULL, NULL, 0)) {
- strbuf_addch(&buf, '"');
- quote_c_style(prefix, &buf, NULL, 1);
- quote_c_style(path, &buf, NULL, 1);
- strbuf_addch(&buf, '"');
- } else {
- strbuf_addstr(&buf, prefix);
- strbuf_addstr(&buf, path);
- }
+ quote_two_c_style(&buf, prefix, path, 0);
strbuf_addstr(&buf, c_reset);
puts(buf.buf);
}