!21 fix select error

From: @wangmengc 
Reviewed-by: @ut-wanglujun 
Signed-off-by: @ut-wanglujun
This commit is contained in:
openeuler-ci-bot 2024-05-09 07:54:32 +00:00 committed by Gitee
commit 3c368ff49c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,29 @@
From e7dfff81605834dcc6b879963d820c60aef972b0 Mon Sep 17 00:00:00 2001
From: wangmengc <wangmengc@uniontech.com>
Date: Thu, 9 May 2024 10:58:58 +0800
Subject: [PATCH] fix select error
---
builtins_rust/read/src/lib.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtins_rust/read/src/lib.rs b/builtins_rust/read/src/lib.rs
index d08da49..de8bbd8 100644
--- a/builtins_rust/read/src/lib.rs
+++ b/builtins_rust/read/src/lib.rs
@@ -770,10 +770,10 @@ pub extern "C" fn r_read_builtin(mut list: *mut WordList) -> i32 {
//和-d相关 -n 0可以退出有显示
if saw_escape != 0 {
let t = dequote_string(input_string);
- var = bind_variable("REPLY".as_ptr() as *const c_char, t, 0);
+ var = bind_variable( b"REPLY\0" as *const u8 as *const libc::c_char,t, 0);
libc::free(t as *mut c_void);
} else {
- var = bind_variable("REPLY".as_ptr() as *const c_char, input_string, 0);
+ var = bind_variable( b"REPLY\0" as *const u8 as *const libc::c_char,input_string, 0);
}
let cond = var.is_null()
|| ((*var).attributes & 0x0000002) != 0
--
2.39.3

View File

@ -6,7 +6,7 @@
Version: %{baseversion}%{patchleveltag}
Name: utshell
Summary: The utshell respect Bash
Release: 0%{?dist}.2
Release: 0%{?dist}.3
License: GPLv3+
Source0: utshell-%{baseversion}.tar.gz
@ -17,7 +17,7 @@ Patch0002: 0002-fix-kill-l.patch
Patch0003: 0003-fix-exec-c-exec-l-Redundant-output.patch
Patch0004: 0004-fix-complete-p-no-display.patch
Patch0005: 0005-fix-translation-files-correlation.patch
Patch0006: 0006-fix-select-error.patch
# Other patches
# We don't want to add '/etc:/usr/etc' in standard utils path.
@ -134,6 +134,9 @@ end
%{_includedir}/%{name}
%changelog
* Thu May 9 2024 wangmeng<wangmengc@uniontech.com> - 0.5.0-0.3
- fix:I9CANW select 关键字没有输出
* Thu Apr 11 2024 wangyaoyong <yaoyong.oerv@isrc.iscas.ac.cn> - 0.5.0-0.2
- update ExclusiveArch: riscv to riscv64