From 2eb44d9608449f9633bd31338a99b8a8d19b24d7 Mon Sep 17 00:00:00 2001 From: pathoswithin Date: Fri, 7 Oct 2016 12:55:28 +0000 Subject: [PATCH] FAT: no trash in folder output git-svn-id: svn://kolibrios.org@6576 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/fs/fat.inc | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/kernel/trunk/fs/fat.inc b/kernel/trunk/fs/fat.inc index a9100e92bc..0c12e547b1 100644 --- a/kernel/trunk/fs/fat.inc +++ b/kernel/trunk/fs/fat.inc @@ -1406,18 +1406,19 @@ fat_entry_to_bdfe2: mov [esi+36], eax ; file size (high dword) test ebp, ebp jz .ret - push ecx edi - lea edi, [esi+40] + add esi, 40 + push edi esi + mov edi, esi mov esi, ebp - mov ecx, 263 - test byte [esi-4], 1 + test byte [ebp-4], 1 jz .ansi - mov ecx, 260/2 - rep movsd - mov [edi-2], ax -@@: - mov esi, edi - pop edi ecx +.uni: + lodsw + stosw + test eax, eax + jnz .uni + pop esi edi + add esi, 520 .ret: ret @@ -1425,10 +1426,11 @@ fat_entry_to_bdfe2: lodsw call uni2ansi_char stosb - loop .ansi - xor eax, eax - stosb - jmp @b + test al, al + jnz .ansi + pop esi edi + add esi, 264 + ret bdfe_to_fat_entry: ; convert BDFE at edx to FAT entry at edi