From: Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
Subject: [PATCH] Fix #628184 - Giggle does not display diff for files that have spaces in names

Git diff is compliant to GNU patch expected format:
when a filename contains a SP a TAB is added.
See Git's commit 1a9eb3b9d50367bee8fe85022684d812816fe531

Signed-off-by: Guilhem Bonnefille <guilhem.bonnefille@gmail.com>

---
 src/giggle-diff-view.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/giggle-diff-view.c b/src/giggle-diff-view.c
index d7105f8..6bfa787 100644
--- a/src/giggle-diff-view.c
+++ b/src/giggle-diff-view.c
@@ -665,6 +665,11 @@ diff_view_parse_patch (GiggleDiffView *view)
 			}
 		} else if (g_str_has_prefix (line, "--- a/") || g_str_has_prefix (line, "+++ b/")) {
 			g_free (filename); filename = g_strdup (line + 6);
+			if (strchr(filename, ' ')) {
+				/* Remove trailing TAB added by git for GNU patch compatibility */
+				size_t len = strlen (filename);
+				filename[len-1] = '\0';
+			}
 		}
 
 		g_free (line);
-- 
tg: (195153b..) fix-diff-space (depends on: debian-testing)
