remove ;1 at the end of file identifiers
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:
Julien CLEMENT 2022-12-25 14:24:09 +01:00
parent 2e7415e1e6
commit 40b4191d2d
2 changed files with 15 additions and 1 deletions

@ -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();