From 7af7b30f2dc162ff4999a5c0e11132796f62b0be Mon Sep 17 00:00:00 2001
From: wangmengc <wangmengc@uniontech.com>
Date: Fri, 13 Dec 2024 17:35:33 +0800
Subject: [PATCH] fix type return error

---
 builtins_rust/type/src/lib.rs | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/builtins_rust/type/src/lib.rs b/builtins_rust/type/src/lib.rs
index 4940fae..c1b470e 100644
--- a/builtins_rust/type/src/lib.rs
+++ b/builtins_rust/type/src/lib.rs
@@ -555,17 +555,16 @@ pub unsafe extern "C" fn r_type_builtin(mut list: *mut WordList) -> i32 {
                 sh_notfound((*(*list).word).word);
             }
         }
-        any_failed = found + any_failed;
-        let _ = any_failed == 0;
-        // (any_failed += found) == 0;
+        
+        any_failed += (found == 0 as libc::c_int) as libc::c_int;
         unsafe {
             list = (*list).next;
         }
     }
     if any_failed == 0 {
-        EXECUTION_SUCCESS!();
+        opt = EXECUTION_SUCCESS!();
     } else {
-        EXECUTION_FAILURE!();
+        opt = EXECUTION_FAILURE!();
     }
     return unsafe { sh_chkwrite(opt) };
 }
-- 
2.39.3

