aboutsummaryrefslogtreecommitdiffstats
path: root/sjis.c
diff options
context:
space:
mode:
Diffstat (limited to 'sjis.c')
-rw-r--r--sjis.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sjis.c b/sjis.c
index c71b0ad689..f7d7d52265 100644
--- a/sjis.c
+++ b/sjis.c
@@ -29,7 +29,7 @@
#include "regenc.h"
-static int EncLen_SJIS[] = {
+static const int EncLen_SJIS[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -167,21 +167,16 @@ sjis_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end)
static int
sjis_is_code_ctype(OnigCodePoint code, unsigned int ctype)
{
- if ((ctype & ONIGENC_CTYPE_WORD) != 0) {
- if (code < 128)
- return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
- else {
+ if (code < 128)
+ return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
+ else {
+ if ((ctype & (ONIGENC_CTYPE_WORD |
+ ONIGENC_CTYPE_GRAPH | ONIGENC_CTYPE_PRINT)) != 0) {
return (sjis_code_to_mbclen(code) > 1 ? TRUE : FALSE);
}
-
- ctype &= ~ONIGENC_CTYPE_WORD;
- if (ctype == 0) return FALSE;
}
- if (code < 128)
- return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
- else
- return FALSE;
+ return FALSE;
}
static UChar*