5 Star 0 Fork 7

src-openEuler/utshell

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0008-fix-echo-a.z.patch 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
wangmengc 提交于 2024-12-13 17:52 +08:00 . 修改echo和type命令报错
From 35f29adb96c082cd94ec0c72c62556b4fde1e05c Mon Sep 17 00:00:00 2001
From: wangmengc <wangmengc@uniontech.com>
Date: Fri, 13 Dec 2024 17:15:50 +0800
Subject: [PATCH] fix echo {a..z}
---
r_braces/src/lib.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/r_braces/src/lib.rs b/r_braces/src/lib.rs
index ee83ac1..d36ff1f 100644
--- a/r_braces/src/lib.rs
+++ b/r_braces/src/lib.rs
@@ -378,7 +378,7 @@ pub unsafe extern "C" fn brace_expand(
loop {
if *amble.offset(j as isize) as libc::c_int == 0 as libc::c_int {
tack = expand_seqterm (amble, alen);
- if tack.is_null() {
+ if !tack.is_null() {
break;
}
else if !text.offset((i+1) as isize).is_null() {
@@ -692,7 +692,9 @@ unsafe extern "C" fn expand_seqterm(
lhs = substring(text, 0 as libc::c_int, lhs_l);
rhs = substring(
text,
- (lhs_l + std::mem::size_of::<[libc::c_char; 3]> as libc::c_int - 1 as libc::c_int ),
+ (lhs_l as libc::c_ulong)
+ .wrapping_add(::std::mem::size_of::<[libc::c_char; 3]>() as libc::c_ulong)
+ .wrapping_sub(1 as libc::c_int as libc::c_ulong) as libc::c_int,
tlen as libc::c_int,
);
if *lhs.offset(0 as libc::c_int as isize) as libc::c_int == 0 as libc::c_int
--
2.39.3
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/utshell.git
git@gitee.com:src-openeuler/utshell.git
src-openeuler
utshell
utshell
openEuler-24.03-LTS-Next

搜索帮助

371d5123 14472233 46e8bd33 14472233