From dceaa5fee0755e41e3abf7dd932457110163c96c Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Wed, 2 Dec 2009 22:55:22 +0000 Subject: [PATCH] fixed sysfn 30 broken in rev. 1304 git-svn-id: svn://kolibrios.org@1305 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/fs/fs_lfn.inc | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/kernel/trunk/fs/fs_lfn.inc b/kernel/trunk/fs/fs_lfn.inc index 789dbf5e4..5aa794027 100644 --- a/kernel/trunk/fs/fs_lfn.inc +++ b/kernel/trunk/fs/fs_lfn.inc @@ -971,9 +971,9 @@ sys_current_directory: ; mov esi, [esi+APPDATA.cur_dir] ; mov edx, esi -;get lenght string of appdata.cur_dir -; mov eax, [current_slot] -; mov edi, [eax+APPDATA.cur_dir] +;get length string of appdata.cur_dir + mov eax, [current_slot] + mov edi, [eax+APPDATA.cur_dir] dec ebx jz .set @@ -984,9 +984,6 @@ sys_current_directory: ; sysfunction 30.2: [for app] eax=30,ebx=2,ecx->buffer,edx=len ; for our code: ebx->buffer,ecx=len max_cur_dir equ 0x1000 -;get lenght string of appdata.cur_dir - mov eax, [current_slot] - mov edi, [eax+APPDATA.cur_dir] mov ebx,edi @@ -997,25 +994,27 @@ max_cur_dir equ 0x1000 mov ecx,max_cur_dir repne scasb ;find zerro at and string - jcxz .error ;ecx=0 and destination buffer is too small. + jnz .error ; no zero in cur_dir: internal error, should not happen sub edi,ebx ;lenght for copy inc edi mov [esp+32+8],edi ;return in eax - cmp edx,edi ;edi must have more than 2 (for / and 0x0) -;sourse string + cmp edx, edi + jbe @f + mov edx, edi +@@: +;source string pop esi ;destination string pop edi - jb .ret + cmp edx, 1 + jbe .ret mov al,'/' ;start string with '/' stosb mov ecx,edx rep movsb ;copy string - xor eax,eax - mov byte [edi],al ;set zerro .ret: ret .error: add esp,8