1 |
ssuominen 13/02/23 08:46:39 |
2 |
|
3 |
Added: |
4 |
libimobiledevice-1.1.4-property_list_service-do-not-strip-non-ASCII-charact.patch |
5 |
Log: |
6 |
Add patch to avoid multi-byte characters from being stripped |
7 |
|
8 |
(Portage version: 2.2.0_alpha163/cvs/Linux x86_64, signed Manifest commit with key 4868F14D) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 app-pda/libimobiledevice/files/libimobiledevice-1.1.4-property_list_service-do-not-strip-non-ASCII-charact.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-pda/libimobiledevice/files/libimobiledevice-1.1.4-property_list_service-do-not-strip-non-ASCII-charact.patch?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-pda/libimobiledevice/files/libimobiledevice-1.1.4-property_list_service-do-not-strip-non-ASCII-charact.patch?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: libimobiledevice-1.1.4-property_list_service-do-not-strip-non-ASCII-charact.patch |
17 |
=================================================================== |
18 |
From 060e3f2683ed2b0b08e1a31deb9608a99e193b4a Mon Sep 17 00:00:00 2001 |
19 |
From: Christophe Fergeau <teuf@×××××.org> |
20 |
Date: Tue, 26 Jun 2012 00:03:30 +0200 |
21 |
Subject: [PATCH] property_list_service: do not strip non-ASCII characters from |
22 |
XML plists |
23 |
|
24 |
'content' is declared as char content[] so if char is signed, all characters with the high bit set will be negative so they will be < 0x20. This means the code will strip all non-ASCII (multi-byte) UTF-8 characters and replace them with spaces. This commit fixes it now by really only considering ASCII characters. |
25 |
--- |
26 |
src/property_list_service.c | 2 +- |
27 |
1 file changed, 1 insertion(+), 1 deletion(-) |
28 |
|
29 |
diff --git a/src/property_list_service.c b/src/property_list_service.c |
30 |
index 8634864..c9a8edf 100644 |
31 |
--- a/src/property_list_service.c |
32 |
+++ b/src/property_list_service.c |
33 |
@@ -250,7 +250,7 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis |
34 |
} else { |
35 |
/* iOS 4.3+ hack: plist data might contain invalid characters, thus we convert those to spaces */ |
36 |
for (bytes = 0; bytes < pktlen-1; bytes++) { |
37 |
- if ((content[bytes] < 0x20) && (content[bytes] != 0x09) && (content[bytes] != 0x0a) && (content[bytes] != 0x0d)) |
38 |
+ if ((content[bytes] >= 0) && (content[bytes] < 0x20) && (content[bytes] != 0x09) && (content[bytes] != 0x0a) && (content[bytes] != 0x0d)) |
39 |
content[bytes] = 0x20; |
40 |
} |
41 |
plist_from_xml(content, pktlen, plist); |
42 |
-- |
43 |
1.8.1.2 |