{"thread":{"id":"6757","subject":"[PATCH] diff.c: Properly quote file names in diff --summary output.","startedAt":"2007-02-10T14:37:48Z","lastAt":"2007-02-10T14:37:48Z","messageCount":1,"participants":["Alexandre Julliard"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"34102","messageId":"87ireadqo3.fsf@wine.dyndns.org","threadId":"6757","inReplyTo":null,"subject":"[PATCH] diff.c: Properly quote file names in diff --summary output.","fromName":"Alexandre Julliard","fromEmail":"julliard@winehq.org","sentAt":"2007-02-10T14:37:48Z","receivedAt":"2007-02-10T14:37:48Z","isPatch":true,"sender":{"key":"julliard@winehq.org","avatar":null},"body":"Signed-off-by: Alexandre Julliard <julliard@winehq.org>\n---\n diff.c |   17 ++++++++++++-----\n 1 files changed, 12 insertions(+), 5 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 4c642d7..e036aae 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -2409,19 +2409,24 @@ static void flush_one_pair(struct diff_filepair *p, struct diff_options *opt)\n \n static void show_file_mode_name(const char *newdelete, struct diff_filespec *fs)\n {\n+\tchar *name = quote_one(fs->path);\n \tif (fs->mode)\n-\t\tprintf(\" %s mode %06o %s\\n\", newdelete, fs->mode, fs->path);\n+\t\tprintf(\" %s mode %06o %s\\n\", newdelete, fs->mode, name);\n \telse\n-\t\tprintf(\" %s %s\\n\", newdelete, fs->path);\n+\t\tprintf(\" %s %s\\n\", newdelete, name);\n+\tfree(name);\n }\n \n \n static void show_mode_change(struct diff_filepair *p, int show_name)\n {\n \tif (p->one->mode && p->two->mode && p->one->mode != p->two->mode) {\n-\t\tif (show_name)\n+\t\tif (show_name) {\n+\t\t\tchar *name = quote_one(p->two->path);\n \t\t\tprintf(\" mode change %06o => %06o %s\\n\",\n-\t\t\t       p->one->mode, p->two->mode, p->two->path);\n+\t\t\t       p->one->mode, p->two->mode, name);\n+\t\t\tfree(name);\n+\t\t}\n \t\telse\n \t\t\tprintf(\" mode change %06o => %06o\\n\",\n \t\t\t       p->one->mode, p->two->mode);\n@@ -2455,8 +2460,10 @@ static void diff_summary(struct diff_filepair *p)\n \t\tbreak;\n \tdefault:\n \t\tif (p->score) {\n-\t\t\tprintf(\" rewrite %s (%d%%)\\n\", p->two->path,\n+\t\t\tchar *name = quote_one(p->two->path);\n+\t\t\tprintf(\" rewrite %s (%d%%)\\n\", name,\n \t\t\t\t(int)(0.5 + p->score * 100.0/MAX_SCORE));\n+\t\t\tfree(name);\n \t\t\tshow_mode_change(p, 0);\n \t\t} else\tshow_mode_change(p, 1);\n \t\tbreak;\n-- \n1.5.0.rc4.31.g6289\n\n-- \nAlexandre Julliard\njulliard@winehq.org\n"}]}