Added
Link Here
|
1 |
--- encoding.c.orig 2020-02-05 12:09:38.000000000 -0800 |
2 |
+++ encoding.c 2021-02-14 11:15:26.074193000 -0800 |
3 |
@@ -43,7 +43,7 @@ |
4 |
# ifdef UTF8 |
5 |
static int recode_char __P((int, int, int)); |
6 |
static int recode_char_to_encoding __P((int, int)); |
7 |
-static void comb_tofront __P((int, int)); |
8 |
+static void comb_tofront __P((int)); |
9 |
# ifdef DW_CHARS |
10 |
static int recode_char_dw __P((int, int *, int, int)); |
11 |
static int recode_char_dw_to_encoding __P((int, int *, int)); |
12 |
@@ -1263,6 +1263,8 @@ |
13 |
{0x30000, 0x3FFFD}, |
14 |
}; |
15 |
|
16 |
+ if (c >- 0xdf00 && c <= 0xdfff) |
17 |
+ return 1; /* dw comining sequence */ |
18 |
return ((bisearch(c, wide, sizeof(wide) / sizeof(struct interval) - 1)) || |
19 |
(cjkwidth && |
20 |
bisearch(c, ambiguous, |
21 |
@@ -1330,11 +1332,12 @@ |
22 |
} |
23 |
|
24 |
static void |
25 |
-comb_tofront(root, i) |
26 |
-int root, i; |
27 |
+comb_tofront( i) |
28 |
+int i; |
29 |
{ |
30 |
for (;;) |
31 |
{ |
32 |
+ int root = i >= 0x700 ? 0x801 : 0x800; |
33 |
debug1("bring to front: %x\n", i); |
34 |
combchars[combchars[i]->prev]->next = combchars[i]->next; |
35 |
combchars[combchars[i]->next]->prev = combchars[i]->prev; |
36 |
@@ -1396,9 +1399,9 @@ |
37 |
{ |
38 |
/* full, recycle old entry */ |
39 |
if (c1 >= 0xd800 && c1 < 0xe000) |
40 |
- comb_tofront(root, c1 - 0xd800); |
41 |
+ comb_tofront(c1 - 0xd800); |
42 |
i = combchars[root]->prev; |
43 |
- if (c1 == i + 0xd800) |
44 |
+ if (i == 0x800 || i == 0x801 || c1 == i + 0xd800) |
45 |
{ |
46 |
/* completely full, can't recycle */ |
47 |
debug("utf8_handle_comp: completely full!\n"); |
48 |
@@ -1422,7 +1425,7 @@ |
49 |
mc->font = (i >> 8) + 0xd8; |
50 |
mc->fontx = 0; |
51 |
debug3("combinig char %x %x -> %x\n", c1, c, i + 0xd800); |
52 |
- comb_tofront(root, i); |
53 |
+ comb_tofront(i); |
54 |
} |
55 |
|
56 |
#else /* !UTF8 */ |