blob: 2ed3b35735b165e57774a43f2f7b8781baf07a3c (
plain)
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
32
33
34
35
36
37
38
39
|
https://bugs.gentoo.org/322047
--- a/zipfile.c
+++ b/zipfile.c
@@ -5406,7 +5406,9 @@ int putlocal(z, rewrite)
if (z->flg & UTF8_BIT) {
/* If this flag is set, then restore UTF-8 as path name */
use_uname = 1;
+ tempzn -= nam;
nam = strlen(z->uname);
+ tempzn += nam;
} else {
/* use extra field */
add_Unicode_Path_local_extra_field(z);
@@ -5647,7 +5650,9 @@ int putcentral(z)
if (z->flg & UTF8_BIT) {
/* If this flag is set, then restore UTF-8 as path name */
use_uname = 1;
+ tempzn -= nam;
nam = strlen(z->uname);
+ tempzn += nam;
} else {
add_Unicode_Path_cen_extra_field(z);
}
--- a/zipnote.c
+++ b/zipnote.c
@@ -575,6 +575,13 @@ char **argv; /* command line
strcpy(z->iname, a+2);
#endif
+#ifdef UNICODE_SUPPORT
+#define UTF8_BIT (1 << 11)
+ if (using_utf8) {
+ z->uname = z->iname;
+ }
+#endif
+
/*
* Don't update z->nam here, we need the old value a little later.....
* The update is handled in zipcopy().
|