diff --git a/bash-5.1/builtins_rust/common/src/lib.rs b/bash-5.1/builtins_rust/common/src/lib.rs index 696f3bcbe3e5a857c4c702a9ba73adabddae76b6..332e7e23de0a71579f449bb62c962ac2bc30a414 100644 --- a/bash-5.1/builtins_rust/common/src/lib.rs +++ b/bash-5.1/builtins_rust/common/src/lib.rs @@ -1757,7 +1757,7 @@ pub extern "C" fn r_builtin_unbind_variable(vname:*const c_char)->i32{ pub extern "C" fn get_local_str()-> Vec{ let lang : String; - match var("LANGUAGE") { + match var("LANG") { Ok(v) => lang = v , Err(e) => { @@ -1767,7 +1767,8 @@ pub extern "C" fn get_local_str()-> Vec{ } // println!("now language is {:?}",lang); //parse() 用于类型转换 - let langid : LanguageIdentifier = lang.parse().expect("wrong language"); + let v: Vec<_> = lang.split('.').collect(); + let langid : LanguageIdentifier = v[0].parse().expect("wrong language"); let locales = vec![langid.into()]; return locales; } diff --git a/bash-5.1/builtins_rust/jobs/src/lib.rs b/bash-5.1/builtins_rust/jobs/src/lib.rs index 6b9fa888cfed3ca6a2f719357dcd43e56bb70c55..d16b8941c3ef2b050e444c3c72a4e74f859217a3 100644 --- a/bash-5.1/builtins_rust/jobs/src/lib.rs +++ b/bash-5.1/builtins_rust/jobs/src/lib.rs @@ -330,7 +330,11 @@ macro_rules! CMD_INHIBIT_EXPANSION {/* Do not expand the command words. */ #[macro_export] macro_rules! get_job_by_jid { ($ind:expr) => { + //(*((jobs as usize + ($ind*8) as usize ) as *mut*mut JOB) as *mut JOB) + //println!("====jobs.offset={:?}", (*jobs.offset($ind as isize))); + //(*((*jobs.offset($ind)) as *mut *mut JOB) as *mut JOB) (*((jobs as usize + ($ind*8) as usize ) as *mut*mut JOB) as *mut JOB) + } } diff --git a/bash-5.1/builtins_rust/umask/src/lib.rs b/bash-5.1/builtins_rust/umask/src/lib.rs index 399070d0153136d4ca5cf95ea218c55c50c8dc34..5ad75042953e863e2a8b830c4ed2a212362d6692 100644 --- a/bash-5.1/builtins_rust/umask/src/lib.rs +++ b/bash-5.1/builtins_rust/umask/src/lib.rs @@ -247,7 +247,15 @@ pub extern "C" fn r_umask_builtin(mut list:*mut WordList) ->i32{ else{ /* Display the UMASK for this user. */ umask_arg = umask(0o22); umask(umask_arg); - + if pflag != 0{ + if print_symbolically != 0{ + println!("umask -S"); + } + else{ + print!("umask ") + } + } +/* if pflag != 0{ if print_symbolically != 0{ println!("umask \" -S\" "); @@ -256,7 +264,7 @@ pub extern "C" fn r_umask_builtin(mut list:*mut WordList) ->i32{ println!("umask \"\" ") } } - +*/ if print_symbolically != 0{ r_print_symbolic_umask(umask_arg); } diff --git a/record.txt b/record.txt index cbbece17e3efbaba196cdb797b03b481ed86d4a6..6a2032335f7955a7a4e0e8d9cee6bba71dcaf736 100644 --- a/record.txt +++ b/record.txt @@ -80,3 +80,4 @@ 79 80 81 +82