Skip to content

Commit e4a275a

Browse files
committed
save: Fix XML escape table
Regressed with 2adcde3.
1 parent 7d97290 commit e4a275a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tools/genEscape.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
r += "'%s'," % c
3535
pos += 1
3636

37-
print('static const char xmlEscapeContent[] = {%s\n};\n' % r)
37+
print('static const signed char xmlEscapeContent[] = {%s\n};\n' % r)
3838

3939
### xmlEscapeTab
4040

@@ -45,7 +45,7 @@
4545

4646
if chr(i) in escape:
4747
v = offset[i]
48-
elif i != 9 and i != 10 and i < 20:
48+
elif i != 9 and i != 10 and i < 32:
4949
v = 0
5050
else:
5151
v = -1
@@ -54,7 +54,7 @@
5454
else: r += ' '
5555
r += '%2d,' % v
5656

57-
print('static const char xmlEscapeTab[128] = {%s\n};\n' % r)
57+
print('static const signed char xmlEscapeTab[128] = {%s\n};\n' % r)
5858

5959
### xmlEscapeTabAttr
6060

@@ -65,7 +65,7 @@
6565

6666
if chr(i) in escape:
6767
v = offset[i]
68-
elif i != 9 and i != 10 and i < 20:
68+
elif i != 9 and i != 10 and i < 32:
6969
v = 0
7070
else:
7171
v = -1

xmlsave.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static const char xmlEscapeContent[] = {
132132

133133
static const signed char xmlEscapeTab[128] = {
134134
0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 20, 0, 0,
135-
0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
135+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136136
-1, -1, -1, -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1,
137137
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, -1, 44, -1,
138138
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -143,7 +143,7 @@ static const signed char xmlEscapeTab[128] = {
143143

144144
static const signed char xmlEscapeTabAttr[128] = {
145145
0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 14, 0, 0, 20, 0, 0,
146-
0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
146+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
147147
-1, -1, 26, -1, -1, -1, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1,
148148
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, -1, 44, -1,
149149
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,

0 commit comments

Comments
 (0)