remove ;1 at the end of file identifiers
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
parent
2e7415e1e6
commit
40b4191d2d
@ -73,7 +73,15 @@ pub struct IsoDir {
|
|||||||
impl IsoDir {
|
impl IsoDir {
|
||||||
#[allow(unaligned_references)]
|
#[allow(unaligned_references)]
|
||||||
pub fn get_idf(&self) -> &[u8] {
|
pub fn get_idf(&self) -> &[u8] {
|
||||||
unsafe { core::slice::from_raw_parts(self.idf.as_ptr(), self.idf_len as usize) }
|
let mut len: usize = self.idf_len as usize;
|
||||||
|
unsafe {
|
||||||
|
let mut idf = core::slice::from_raw_parts(self.idf.as_ptr(), len as usize);
|
||||||
|
if len > 2 && idf[len - 2] == b';' && idf[len - 1] == b'1' {
|
||||||
|
len -= 2;
|
||||||
|
idf = core::slice::from_raw_parts(self.idf.as_ptr(), len as usize);
|
||||||
|
}
|
||||||
|
idf
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn next_entry(&self) -> &IsoDir {
|
pub fn next_entry(&self) -> &IsoDir {
|
||||||
|
@ -42,12 +42,15 @@ impl FileSystem for IsoFS {
|
|||||||
.filter(|p| p != &"");
|
.filter(|p| p != &"");
|
||||||
|
|
||||||
for path_component in path_it {
|
for path_component in path_it {
|
||||||
|
let mut found = false;
|
||||||
while curr_entry.idf_len != 0 {
|
while curr_entry.idf_len != 0 {
|
||||||
serial_println!("{:?}", curr_entry.idf_len);
|
serial_println!("{:?}", curr_entry.idf_len);
|
||||||
serial_println!("{:?}", alloc::str::from_utf8(curr_entry.get_idf()).unwrap());
|
serial_println!("{:?}", alloc::str::from_utf8(curr_entry.get_idf()).unwrap());
|
||||||
|
|
||||||
|
// Found entry
|
||||||
if curr_entry.matches(path_component) {
|
if curr_entry.matches(path_component) {
|
||||||
serial_println!("Found {}", path_component);
|
serial_println!("Found {}", path_component);
|
||||||
|
found = true;
|
||||||
curr_entry_block = read_block(curr_entry.data_blk.le).await;
|
curr_entry_block = read_block(curr_entry.data_blk.le).await;
|
||||||
curr_entry = unserialize(curr_entry_block.as_ptr());
|
curr_entry = unserialize(curr_entry_block.as_ptr());
|
||||||
break;
|
break;
|
||||||
@ -56,6 +59,9 @@ impl FileSystem for IsoFS {
|
|||||||
// Next entry
|
// Next entry
|
||||||
curr_entry = curr_entry.next_entry();
|
curr_entry = curr_entry.next_entry();
|
||||||
}
|
}
|
||||||
|
if !found {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let fd = IsoFD::new();
|
let fd = IsoFD::new();
|
||||||
|
Loading…
Reference in New Issue
Block a user