Explorar o código

fix: lookup path trim /

liujingx hai 10 meses
pai
achega
6c47788cc9
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/ext4/high_level.rs

+ 2 - 1
src/ext4/high_level.rs

@@ -25,6 +25,7 @@ impl Ext4 {
     ///
     /// `Ok(inode)` - Inode id of the object
     pub fn generic_lookup(&self, root: InodeId, path: &str) -> Result<InodeId> {
+        trace!("generic_lookup({}, {})", root, path);
         // Search from the given parent inode
         let mut cur = root;
         let search_path = Self::split_path(path);
@@ -137,7 +138,7 @@ impl Ext4 {
 
     /// A helper function to split a path by '/'
     fn split_path(path: &str) -> Vec<String> {
-        let _ = path.trim_start_matches("/");
+        let path = path.trim_start_matches("/");
         if path.is_empty() {
             return vec![]; // root
         }