diff --git a/utshell-0.5/r_error/src/lib.rs b/utshell-0.5/r_error/src/lib.rs index 9c4d6c718dce8da7f1a49bef637c2bb6d10dd858..dbbfb190714e661a736d04adcd5c628b9965b354 100644 --- a/utshell-0.5/r_error/src/lib.rs +++ b/utshell-0.5/r_error/src/lib.rs @@ -88,7 +88,7 @@ pub unsafe extern "C" fn file_error(mut filename: *const libc::c_char) { strerror(*__errno_location()), ); } - +/* #[no_mangle] pub unsafe extern "C" fn programming_error( mut format: *const libc::c_char, @@ -295,7 +295,7 @@ pub unsafe extern "C" fn parser_error( ); } } - +*/ static mut cmd_error_table: [*const libc::c_char; 5] = [ b"unknown command error\0" as *const u8 as *const libc::c_char, b"bad command type\0" as *const u8 as *const libc::c_char, @@ -358,4 +358,16 @@ pub unsafe extern "C" fn err_unboundvar(mut s: *const libc::c_char) { ), s, ); +} + +#[no_mangle] +pub unsafe extern "C" fn err_readonly(mut s: *const libc::c_char) { + report_error( + dcgettext( + 0 as *const libc::c_char, + b"%s: readonly variable\0" as *const u8 as *const libc::c_char, + 5 as libc::c_int, + ), + s, + ); } \ No newline at end of file