Package: giggle / 0.7-3

upstream-#628184.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From c4963107ee97b6bf045b805ed3b8f9f824c62ccb Mon Sep 17 00:00:00 2001
From: Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
Date: Thu, 4 Apr 2013 14:47:19 +0100
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 file changed, 5 insertions(+)

--- a/src/giggle-diff-view.c
+++ b/src/giggle-diff-view.c
@@ -662,8 +662,13 @@
 				file = NULL;
 			}
 		} 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);