代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/vim 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 5921aeb5741fc6e84c870d68c7c35b93ad0c9f87 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <Bram@vim.org>
Date: Sat, 19 Feb 2022 11:20:12 +0000
Subject: [PATCH] patch 8.2.4418: crash when using special multi-byte character
Problem: Crash when using special multi-byte character.
Solution: Don't use isalpha() for an arbitrary character.
Conflict:
upstream patches:
+ call assert_fails('tc űŤŤŤ¦*', 'E344:')
openEuler patches:
+ call assert_fails('tc űŤŤŤ¦*', 'E472:')
---
src/charset.c | 6 ++++++
src/filepath.c | 2 +-
src/proto/charset.pro | 2 +-
src/testdir/test_autochdir.vim | 7 +++++++
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/charset.c b/src/charset.c
index a768c17..847a01a 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1654,6 +1654,12 @@ vim_isupper(int c)
return isupper(c);
}
+ int
+vim_isalpha(int c)
+{
+ return vim_islower(c) || vim_isupper(c);
+}
+
int
vim_toupper(int c)
{
diff --git a/src/filepath.c b/src/filepath.c
index 01d2dcb..c7f0265 100644
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -3300,7 +3300,7 @@ unix_expandpath(
else if (path_end >= path + wildoff
&& (vim_strchr((char_u *)"*?[{~$", *path_end) != NULL
|| (!p_fic && (flags & EW_ICASE)
- && isalpha(PTR2CHAR(path_end)))))
+ && vim_isalpha(PTR2CHAR(path_end)))))
e = p;
if (has_mbyte)
{
diff --git a/src/proto/charset.pro b/src/proto/charset.pro
index c582a8c..2a928e3 100644
--- a/src/proto/charset.pro
+++ b/src/proto/charset.pro
@@ -47,6 +47,7 @@ int vim_isxdigit(int c);
int vim_isbdigit(int c);
int vim_islower(int c);
int vim_isupper(int c);
+int vim_isalpha(int c);
int vim_toupper(int c);
int vim_tolower(int c);
char_u *skiptowhite(char_u *p);
@@ -59,5 +60,4 @@ int hexhex2nr(char_u *p);
int rem_backslash(char_u *str);
void backslash_halve(char_u *p);
char_u *backslash_halve_save(char_u *p);
-void ebcdic2ascii(char_u *buffer, int len);
/* vim: set ft=c : */
diff --git a/src/testdir/test_autochdir.vim b/src/testdir/test_autochdir.vim
index 1473854..99fc9ae 100644
--- a/src/testdir/test_autochdir.vim
+++ b/src/testdir/test_autochdir.vim
@@ -24,3 +24,10 @@ func Test_set_filename()
call chdir(cwd)
call delete('samples/Xtest')
endfunc
+
+func Test_multibyte()
+ " using an invalid character should not cause a crash
+ set wic
+ call assert_fails('tc űŤŤŤ¦*', 'E472:')
+ set nowic
+endfunc
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。