aboutsummaryrefslogtreecommitdiffstats
path: root/chinese
diff options
context:
space:
mode:
authorijliao <ijliao@FreeBSD.org>2004-08-02 10:45:15 +0800
committerijliao <ijliao@FreeBSD.org>2004-08-02 10:45:15 +0800
commit4d482b7264ae6addf4c1e50d8257fcd14203a7e6 (patch)
tree49f4dc05affb89914b3c0f11e6a3b8b0de0699a1 /chinese
parentb37fa578ea34a59805ba4840406efb0e9f56c1b4 (diff)
downloadfreebsd-ports-gnome-4d482b7264ae6addf4c1e50d8257fcd14203a7e6.tar.gz
freebsd-ports-gnome-4d482b7264ae6addf4c1e50d8257fcd14203a7e6.tar.zst
freebsd-ports-gnome-4d482b7264ae6addf4c1e50d8257fcd14203a7e6.zip
add zh-unrar
PR: 69852 Submitted by: statue <statue@freebsd.netlab.cse.yzu.edu.tw>
Diffstat (limited to 'chinese')
-rw-r--r--chinese/Makefile1
-rw-r--r--chinese/unrar/Makefile17
-rw-r--r--chinese/unrar/files/patch-arcread.cpp27
-rw-r--r--chinese/unrar/files/patch-unicode.cpp18
4 files changed, 63 insertions, 0 deletions
diff --git a/chinese/Makefile b/chinese/Makefile
index 06ce874e7c4b..2d44a09c7be9 100644
--- a/chinese/Makefile
+++ b/chinese/Makefile
@@ -111,6 +111,7 @@
SUBDIR += tocps
SUBDIR += ttf2pt1
SUBDIR += ttfm
+ SUBDIR += unrar
SUBDIR += unzip
SUBDIR += ve
SUBDIR += vflib
diff --git a/chinese/unrar/Makefile b/chinese/unrar/Makefile
new file mode 100644
index 000000000000..d9ef056b47d8
--- /dev/null
+++ b/chinese/unrar/Makefile
@@ -0,0 +1,17 @@
+# New ports collection makefile for: zh-unrar
+# Date created: 1 Auguest 2004
+# Whom: Shen Chuan-Hsing <statue@freebsd.sinica.edu.tw>
+#
+# $FreeBSD$
+#
+
+CATEGORIES= chinese
+
+MAINTAINER= ports@FreeBSD.org
+
+MASTERDIR= ${.CURDIR}/../../archivers/unrar
+
+EXTRA_PATCHES= ${.CURDIR}/files/patch-arcread.cpp \
+ ${.CURDIR}/files/patch-unicode.cpp
+
+.include "${MASTERDIR}/Makefile"
diff --git a/chinese/unrar/files/patch-arcread.cpp b/chinese/unrar/files/patch-arcread.cpp
new file mode 100644
index 000000000000..e8c8c9b7210a
--- /dev/null
+++ b/chinese/unrar/files/patch-arcread.cpp
@@ -0,0 +1,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)
diff --git a/chinese/unrar/files/patch-unicode.cpp b/chinese/unrar/files/patch-unicode.cpp
new file mode 100644
index 000000000000..9bd86779924a
--- /dev/null
+++ b/chinese/unrar/files/patch-unicode.cpp
@@ -0,0 +1,18 @@
+--- unicode.cpp.orig Sun Aug 1 01:54:23 2004
++++ unicode.cpp Sun Aug 1 01:54:56 2004
+@@ -2,6 +2,7 @@
+
+ void WideToChar(const wchar *Src,char *Dest,int DestSize)
+ {
++#if 0 /* patch for chinese filename */
+ #ifdef _WIN_32
+ WideCharToMultiByte(CP_ACP,0,Src,-1,Dest,DestSize,NULL,NULL);
+ #else
+@@ -18,6 +19,7 @@
+ if (Src[I]==0)
+ break;
+ }
++#endif
+ #endif
+ #endif
+ #endif