summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b9f4416)
raw | patch | inline | side by side (parent: b9f4416)
author | Alexandre Julliard <julliard@winehq.org> | |
Sat, 10 Feb 2007 14:37:48 +0000 (15:37 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 11 Feb 2007 20:53:05 +0000 (12:53 -0800) |
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c | patch | blob | history |
index acd689643cd625cbaa6589b82ac4117971f45211..14684a5c81ca7a42181c4d51c596fb80a43e1a3a 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -2409,19 +2409,24 @@ static void flush_one_pair(struct diff_filepair *p, struct diff_options *opt)
static void show_file_mode_name(const char *newdelete, struct diff_filespec *fs)
{
+ char *name = quote_one(fs->path);
if (fs->mode)
- printf(" %s mode %06o %s\n", newdelete, fs->mode, fs->path);
+ printf(" %s mode %06o %s\n", newdelete, fs->mode, name);
else
- printf(" %s %s\n", newdelete, fs->path);
+ printf(" %s %s\n", newdelete, name);
+ free(name);
}
static void show_mode_change(struct diff_filepair *p, int show_name)
{
if (p->one->mode && p->two->mode && p->one->mode != p->two->mode) {
- if (show_name)
+ if (show_name) {
+ char *name = quote_one(p->two->path);
printf(" mode change %06o => %06o %s\n",
- p->one->mode, p->two->mode, p->two->path);
+ p->one->mode, p->two->mode, name);
+ free(name);
+ }
else
printf(" mode change %06o => %06o\n",
p->one->mode, p->two->mode);
break;
default:
if (p->score) {
- printf(" rewrite %s (%d%%)\n", p->two->path,
+ char *name = quote_one(p->two->path);
+ printf(" rewrite %s (%d%%)\n", name,
(int)(0.5 + p->score * 100.0/MAX_SCORE));
+ free(name);
show_mode_change(p, 0);
} else show_mode_change(p, 1);
break;