Skip to content

Commit

Permalink
Fix .. entry in new directories.
Browse files Browse the repository at this point in the history
  • Loading branch information
thejpster committed Oct 30, 2024
1 parent 8a2bf64 commit 20fc821
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/volume_mgr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use byteorder::{ByteOrder, LittleEndian};
use core::convert::TryFrom;

use crate::fat::{self, BlockCache, FatType, OnDiskDirEntry, RESERVED_ENTRIES};
use crate::fat::{self, BlockCache, OnDiskDirEntry, RESERVED_ENTRIES};

use crate::filesystem::{
Attributes, ClusterId, DirEntry, DirectoryInfo, FileInfo, Mode, RawDirectory, RawFile,
Expand Down Expand Up @@ -978,16 +978,13 @@ where
ctime: now,
attributes: att,
// point at our parent
cluster: match fat_type {
FatType::Fat16 => {
// On FAT16, indicate parent is root using Cluster(0)
if parent_directory_info.cluster == ClusterId::ROOT_DIR {
ClusterId::EMPTY
} else {
parent_directory_info.cluster
}
cluster: {
// On FAT16, indicate parent is root using Cluster(0)
if parent_directory_info.cluster == ClusterId::ROOT_DIR {
ClusterId::EMPTY
} else {
parent_directory_info.cluster
}
FatType::Fat32 => parent_directory_info.cluster,
},
size: 0,
entry_block: new_dir_start_block,
Expand Down

0 comments on commit 20fc821

Please sign in to comment.