aboutsummaryrefslogtreecommitdiffstats
path: root/chinese/docproj
diff options
context:
space:
mode:
authorclive <clive@FreeBSD.org>2006-03-26 23:06:50 +0800
committerclive <clive@FreeBSD.org>2006-03-26 23:06:50 +0800
commit2bdfafa1d7a81d76fb87c3a9f87af78accf87595 (patch)
tree00e490cc27dadf555e62ef40d9aa3affc9575f62 /chinese/docproj
parentd3345d3fa7aa649d08ffefde5b50bb121df305f7 (diff)
downloadfreebsd-ports-gnome-2bdfafa1d7a81d76fb87c3a9f87af78accf87595.tar.gz
freebsd-ports-gnome-2bdfafa1d7a81d76fb87c3a9f87af78accf87595.tar.zst
freebsd-ports-gnome-2bdfafa1d7a81d76fb87c3a9f87af78accf87595.zip
Allow lower case in encoding name.
PR: ports/94948 Submitted by: Intron <intron (at) intron.ac> Prodded by: MAINTAINER (delphij)
Diffstat (limited to 'chinese/docproj')
-rw-r--r--chinese/docproj/Makefile1
-rw-r--r--chinese/docproj/src/cjktexsty/cjktexsty.l22
2 files changed, 15 insertions, 8 deletions
diff --git a/chinese/docproj/Makefile b/chinese/docproj/Makefile
index 740c0acc0375..ad5174575851 100644
--- a/chinese/docproj/Makefile
+++ b/chinese/docproj/Makefile
@@ -9,6 +9,7 @@
PORTNAME= docproj
PORTVERSION= 0.1.20060303
+PORTREVISION= 1
CATEGORIES= chinese
MASTER_SITES= # none
PKGNAMEPREFIX= zh-
diff --git a/chinese/docproj/src/cjktexsty/cjktexsty.l b/chinese/docproj/src/cjktexsty/cjktexsty.l
index cb860a6609b4..1786aefc1331 100644
--- a/chinese/docproj/src/cjktexsty/cjktexsty.l
+++ b/chinese/docproj/src/cjktexsty/cjktexsty.l
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <ctype.h>
#include <iconv.h>
char texencoding[128]="",*cjkencoding=NULL,cjkfont[128]="";
@@ -307,6 +308,7 @@ int
main(int argc, char *argv[])
{
int ch;
+ char *p;
while ((ch = getopt(argc, argv, "ce:f:")) != -1)
{
@@ -316,15 +318,19 @@ main(int argc, char *argv[])
ccmap_enable=1;
break;
case 'e':
- if(strcmp(optarg,"GB2312")==0) cjkencoding="GB";
- else if(strcmp(optarg,"GBK")==0) cjkencoding="GBK";
- else if(strcmp(optarg,"GB18030")==0) cjkencoding="GBK"; /* Not supported by CJK yet */
- else if(strcmp(optarg,"BIG5")==0) cjkencoding="Bg5";
- else if(strcmp(optarg,"EUCJP")==0) cjkencoding="JIS";
- else if(strcmp(optarg,"EUCKR")==0) cjkencoding="KS";
- else if(strcmp(optarg,"UTF-8")==0) cjkencoding="UTF8";
+ if(strcasecmp(optarg,"GB2312")==0) cjkencoding="GB";
+ else if(strcasecmp(optarg,"GBK")==0) cjkencoding="GBK";
+ else if(strcasecmp(optarg,"GB18030")==0) cjkencoding="GBK"; /* Not supported by CJK yet */
+ else if(strcasecmp(optarg,"BIG5")==0) cjkencoding="Bg5";
+ else if(strcasecmp(optarg,"EUCJP")==0) cjkencoding="JIS";
+ else if(strcasecmp(optarg,"EUCKR")==0) cjkencoding="KS";
+ else if(strcasecmp(optarg,"UTF-8")==0) cjkencoding="UTF8";
else cjkencoding=NULL;
- if(cjkencoding!=NULL) strlcpy(texencoding,optarg,sizeof(texencoding));
+ if(cjkencoding!=NULL) {
+ strlcpy(texencoding,optarg,sizeof(texencoding));
+ for(p=texencoding;*p!=0;p++)
+ *p=toupper((int)((unsigned char)*p));
+ }
break;
case 'f':
strlcpy(cjkfont,optarg,sizeof(cjkfont));