From c79bc0bee25b7f48dd939321171387bf384395c3 Mon Sep 17 00:00:00 2001 From: zhanghuanhuan Date: Tue, 10 Oct 2023 15:40:16 +0800 Subject: [PATCH] define static var last_table_searched and add func atoi --- bash-5.1/r_variables/src/lib.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/bash-5.1/r_variables/src/lib.rs b/bash-5.1/r_variables/src/lib.rs index 3023ddb..f8b02fd 100644 --- a/bash-5.1/r_variables/src/lib.rs +++ b/bash-5.1/r_variables/src/lib.rs @@ -98,6 +98,17 @@ pub unsafe extern "C" fn bind_variable( ); } } + + vc = (*vc).down; + } + + return bind_variable_internal( + name, + value, + (*global_variables).table, + 0 as libc::c_int, + flags, + ); } #[derive(Copy, Clone)] @@ -121,3 +132,15 @@ macro_rules! vc_istempenv { ((*$vc).flags & VC_TEMPFLAGS as libc::c_int) == VC_TEMPFLAGS as libc::c_int } } + +static mut last_table_searched: *mut HASH_TABLE = 0 as *const HASH_TABLE + as *mut HASH_TABLE; + +#[inline] +unsafe extern "C" fn atoi(mut __nptr: *const libc::c_char) -> libc::c_int { + return strtol( + __nptr, + 0 as *mut libc::c_void as *mut *mut libc::c_char, + 10 as libc::c_int, + ) as libc::c_int; +} -- Gitee