ports/94948: A patch for the port chinese/docproj
Intron
intron at intron.ac
Sun Mar 26 10:40:17 UTC 2006
>Number: 94948
>Category: ports
>Synopsis: A patch for the port chinese/docproj
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Mar 26 10:40:16 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Intron
>Release: 7.0-CURRENT
>Organization:
China
>Environment:
7.0-CURRENT i386
>Description:
Allow encoding name in lower case.
Please forward this PR to the committee delphij at freebsd.org.
>How-To-Repeat:
>Fix:
--- /usr/ports/chinese/docproj/src/cjktexsty/cjktexsty.l Sun Feb 26 04:10:14 2006
+++ cjktexsty.l Sun Mar 26 18:28:02 2006
@@ -38,6 +38,7 @@
#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 @@
main(int argc, char *argv[])
{
int ch;
+ char *p;
while ((ch = getopt(argc, argv, "ce:f:")) != -1)
{
@@ -316,15 +318,20 @@
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));
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list