utshell/0006-fix-select-error.patch
2024-05-09 11:09:20 +08:00

30 lines
1.2 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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