修复文本文档以'~'结尾报错

This commit is contained in:
陈精华
2022-12-12 10:30:13 +08:00
parent 5704a4182e
commit e9c4e134c6
3 changed files with 17 additions and 14 deletions

View File

@@ -402,7 +402,7 @@ class BytesEncodingDetect extends Encoding {
int row, column;
rawtextlen = rawtext.length;
for (i = 0; i < rawtextlen; i++) {
if (rawtext[i] == '~') {
if (rawtext[i] == '~' && i < rawtextlen - 1) {
if (rawtext[i + 1] == '{') {
hzstart++;
i += 2;
@@ -4641,4 +4641,4 @@ class Encoding {
nicename[OTHER] = "OTHER";
}
}
}