diff --git a/bash-5.1/builtins_rust/alias/src/lib.rs b/bash-5.1/builtins_rust/alias/src/lib.rs index c9e53be3218392630a90ef8e390b91eb4a9f50dc..4b6e1e2b3e734c3d822b5b90a5431ddbbcc33902 100644 --- a/bash-5.1/builtins_rust/alias/src/lib.rs +++ b/bash-5.1/builtins_rust/alias/src/lib.rs @@ -1,5 +1,6 @@ use std::ffi::CStr; +use std::io::{Read, stdout, Write}; //extern crate rcommon; use rcommon::r_sh_notfound; use rcommon::{WordList, WordDesc, EX_USAGE, EXECUTION_SUCCESS, EXECUTION_FAILURE,r_builtin_usage}; @@ -212,18 +213,25 @@ unsafe extern "C" fn print_alias( alias: *mut AliasT, flags: libc::c_int) { let value: *mut libc::c_char; value = sh_single_quote((*alias).value); if flags & 0x1 as libc::c_int != 0 { - printf( - b"alias %s\0" as *const u8 as *const libc::c_char, + print!("alias "); + //printf( + // b"alias %s\0" as *const u8 as *const libc::c_char, if !((*alias).name).is_null() && *((*alias).name).offset(0 as libc::c_int as isize) as libc::c_int == '-' as i32 { - b"-- \0" as *const u8 as *const libc::c_char + // b"-- \0" as *const u8 as *const libc::c_char + print!("-- "); } else { - b"\0" as *const u8 as *const libc::c_char - }, - ); + // b"\0" as *const u8 as *const libc::c_char + print!(" "); + } + //); } + // fflush() + //unsafe { + // std::io::stdout().flush(); + //} println!("{}={}", CStr::from_ptr((*alias).name).to_string_lossy().into_owned(), CStr::from_ptr(value).to_string_lossy().into_owned()); free(value as *mut libc::c_void); 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 dc9e0501ed316a2165a39936894880d0cd69bec8..33c0cb72952c00e663908a88ecfb53bd9e169f55 100644 --- a/record.txt +++ b/record.txt @@ -58,3 +58,4 @@ 80 81 82 +83