1 Star 0 Fork 21

BridgeNorth/tcl

forked from src-openEuler/tcl 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Fix-11ae2be95d-tip-389-branch-string-range-errors-wi.patch 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
yixiangzhike 提交于 2020-07-29 19:59 . update to 8.6.10
From 7fff40c678507ffe82b3c65f1a0277a6da0b906e Mon Sep 17 00:00:00 2001
From: "jan.nijtmans" <nijtmans@users.sourceforge.net>
Date: Fri, 12 Jan 2018 10:03:58 +0000
Subject: [PATCH 0837/1800] Fix [11ae2be95d]: tip-389 branch: string range
errors with code points greater than U+FFFF
---
generic/tclExecute.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index f2cda0ca8..63281a85e 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -5445,7 +5445,7 @@ TEBCresume(
valuePtr->bytes+index, 1);
} else {
char buf[TCL_UTF_MAX] = "";
- Tcl_UniChar ch = Tcl_GetUniChar(valuePtr, index);
+ int ch = Tcl_GetUniChar(valuePtr, index);
/*
* This could be: Tcl_NewUnicodeObj((const Tcl_UniChar *)&ch, 1)
@@ -5453,7 +5453,7 @@ TEBCresume(
* practical use.
*/
- length = Tcl_UniCharToUtf(ch, buf);
+ length = (ch != -1) ? Tcl_UniCharToUtf(ch, buf) : 0;
objResultPtr = Tcl_NewStringObj(buf, length);
}
--
2.19.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/run-is-pig/tcl.git
git@gitee.com:run-is-pig/tcl.git
run-is-pig
tcl
tcl
master

搜索帮助