summaryrefslogtreecommitdiff
path: root/src/unicode.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-08-31 03:42:07 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-08-31 03:42:07 +0200
commit75ed3a79bf4fdcb71dd709495de544cb6cef17b3 (patch)
tree67e4b404206c31d3d7d52673c12eb9f756db5c64 /src/unicode.c
parentc752981613de81bfa2723749b79e80bf0008f27c (diff)
parenta76fa337cc657dbe669ffb8dbdac606d4d6616f1 (diff)
Merge tag 'upstream/6.1.0'
Upstream version 6.1.0
Diffstat (limited to 'src/unicode.c')
-rw-r--r--src/unicode.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/unicode.c b/src/unicode.c
index df20ef9..8812ca2 100644
--- a/src/unicode.c
+++ b/src/unicode.c
@@ -111,8 +111,10 @@ onig_unicode_define_user_property(const char* name, OnigCodePoint* ranges)
n = 0;
for (i = 0; i < len; i++) {
c = name[i];
- if (c <= 0 || c >= 0x80)
+ if (c <= 0 || c >= 0x80) {
+ xfree(s);
return ONIGERR_INVALID_CHAR_PROPERTY_NAME;
+ }
if (c != ' ' && c != '-' && c != '_') {
s[n] = c;
@@ -483,12 +485,13 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
buk = unicode_unfold_key(code);
if (buk != 0) {
if (buk->fold_len == 1) {
+ int un;
items[0].byte_len = len;
items[0].code_len = 1;
items[0].code[0] = *FOLDS1_FOLD(buk->index);
n++;
- int un = FOLDS1_UNFOLDS_NUM(buk->index);
+ un = FOLDS1_UNFOLDS_NUM(buk->index);
for (i = 0; i < un; i++) {
OnigCodePoint unfold = FOLDS1_UNFOLDS(buk->index)[i];
if (unfold != code) {
@@ -517,8 +520,9 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
}
for (fn = 0; fn < 2; fn++) {
+ int index;
cs[fn][0] = FOLDS2_FOLD(buk->index)[fn];
- int index = unicode_fold1_key(&cs[fn][0]);
+ index = unicode_fold1_key(&cs[fn][0]);
if (index >= 0) {
int m = FOLDS1_UNFOLDS_NUM(index);
for (i = 0; i < m; i++) {
@@ -553,8 +557,9 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
}
for (fn = 0; fn < 3; fn++) {
+ int index;
cs[fn][0] = FOLDS3_FOLD(buk->index)[fn];
- int index = unicode_fold1_key(&cs[fn][0]);
+ index = unicode_fold1_key(&cs[fn][0]);
if (index >= 0) {
int m = FOLDS1_UNFOLDS_NUM(index);
for (i = 0; i < m; i++) {
@@ -603,6 +608,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
p += len;
if (p < end) {
int clen;
+ int index;
codes[0] = code;
code = ONIGENC_MBC_TO_CODE(enc, p, end);
@@ -617,7 +623,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
clen = enclen(enc, p);
len += clen;
- int index = unicode_fold2_key(codes);
+ index = unicode_fold2_key(codes);
if (index >= 0) {
m = FOLDS2_UNFOLDS_NUM(index);
for (i = 0; i < m; i++) {