summaryrefslogtreecommitdiff
path: root/chinese/unrar/files/patch-arcread.cpp
blob: e8c8c9b7210a247b8373147caeb1efeb9a3e001d (plain) (blame)
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
--- arcread.cpp.orig	Sun Aug  1 01:55:38 2004
+++ arcread.cpp	Sun Aug  1 01:57:56 2004
@@ -540,6 +540,7 @@
 
 void Archive::ConvertUnknownHeader()
 {
+  int big5=0;
   if (NewLhd.UnpVer<20 && (NewLhd.FileAttr & 0x10))
     NewLhd.Flags|=LHD_DIRECTORY;
   if (NewLhd.HostOS>=HOST_MAX)
@@ -551,6 +552,16 @@
   }
   for (char *s=NewLhd.FileName;*s!=0;s=charnext(s))
   {
+    if (big5==1) /* skip Big5 second byte */
+    {
+      big5=0;
+      continue;
+    }
+    if ((byte)*s>127) /* Big5 first byte */
+    {
+      big5=1;
+      continue;
+    }
     if (*s=='/' || *s=='\\')
       *s=CPATHDIVIDER;
 #if defined(_APPLE) && !defined(UNICODE_SUPPORTED)