Skip to content

Commit 20fc821

Browse files
committed
Fix .. entry in new directories.
1 parent 8a2bf64 commit 20fc821

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/volume_mgr.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use byteorder::{ByteOrder, LittleEndian};
66
use core::convert::TryFrom;
77

8-
use crate::fat::{self, BlockCache, FatType, OnDiskDirEntry, RESERVED_ENTRIES};
8+
use crate::fat::{self, BlockCache, OnDiskDirEntry, RESERVED_ENTRIES};
99

1010
use crate::filesystem::{
1111
Attributes, ClusterId, DirEntry, DirectoryInfo, FileInfo, Mode, RawDirectory, RawFile,
@@ -978,16 +978,13 @@ where
978978
ctime: now,
979979
attributes: att,
980980
// point at our parent
981-
cluster: match fat_type {
982-
FatType::Fat16 => {
983-
// On FAT16, indicate parent is root using Cluster(0)
984-
if parent_directory_info.cluster == ClusterId::ROOT_DIR {
985-
ClusterId::EMPTY
986-
} else {
987-
parent_directory_info.cluster
988-
}
981+
cluster: {
982+
// On FAT16, indicate parent is root using Cluster(0)
983+
if parent_directory_info.cluster == ClusterId::ROOT_DIR {
984+
ClusterId::EMPTY
985+
} else {
986+
parent_directory_info.cluster
989987
}
990-
FatType::Fat32 => parent_directory_info.cluster,
991988
},
992989
size: 0,
993990
entry_block: new_dir_start_block,

0 commit comments

Comments
 (0)