KFar 0.61: uses new version of libini, saves panels mode in ini, bugfixes

git-svn-id: svn://kolibrios.org@1000 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2009-01-25 19:14:27 +00:00
parent e2b2bba7ba
commit 9c55afa3c4

View File

@ -7,8 +7,8 @@ memsize dd mem
dd stacktop dd stacktop
dd 0, app_path dd 0, app_path
version equ '0.6' version equ '0.61'
version_dword equ 0*10000h + 60 version_dword equ 0*10000h + 61
min_width = 54 min_width = 54
max_width = 255 max_width = 255
@ -160,8 +160,8 @@ start:
; load libini.obj and kfar.ini ; load libini.obj and kfar.ini
mov eax, libini_name mov eax, libini_name
mov esi, ini_import mov esi, ini_import
push 3 push 6
pop ebp ; we use version 3 of libini pop ebp ; we use version 6 of libini
call load_dll_and_import call load_dll_and_import
test eax, eax test eax, eax
jnz .noini jnz .noini
@ -401,7 +401,7 @@ exit:
pop esi ecx pop esi ecx
jmp .unload jmp .unload
.unload_done: .unload_done:
if 0 ; commented due to bug in libini ;if 0 ; commented due to bug in libini
cmp [ini.set_int], aIniSetInt cmp [ini.set_int], aIniSetInt
jz .nosave jz .nosave
push [panel1_colmode] push [panel1_colmode]
@ -415,7 +415,7 @@ if 0 ; commented due to bug in libini
push app_path push app_path
call [ini.set_int] call [ini.set_int]
.nosave: .nosave:
end if ;end if
if CHECK_FOR_LEAKS if CHECK_FOR_LEAKS
mov ecx, [panel1_files] mov ecx, [panel1_files]
call pgfree call pgfree
@ -815,8 +815,8 @@ ctrlkey_test4:
ret ret
enum_associations_callback: enum_associations_callback:
; LongBool __stdcall callback(f_name,sec_name,key_name); ; LongBool __stdcall callback(f_name,sec_name,key_name,key_value);
; [esp+4] = f_name, [esp+8] = sec_name, [esp+12] = key_name ; [esp+4] = f_name, [esp+8] = sec_name, [esp+12] = key_name, [esp+16] = key_value
mov esi, [esp+12] mov esi, [esp+12]
mov edi, esi mov edi, esi
@@: @@:
@ -824,16 +824,7 @@ enum_associations_callback:
test al, al test al, al
jnz @b jnz @b
sub esi, edi ; esi = size of key name sub esi, edi ; esi = size of key name
push nullstr mov eax, [esp+16]
push 1024
push saved_file_name
push edi
push dword [esp+16+8]
push dword [esp+20+4]
call [ini.get_str]
test eax, eax
jnz .ret
mov eax, saved_file_name
@@: @@:
inc esi inc esi
inc eax inc eax
@ -870,7 +861,7 @@ enum_associations_callback:
stosb stosb
test al, al test al, al
jnz @b jnz @b
mov esi, saved_file_name mov esi, [esp+16]
@@: @@:
lodsb lodsb
stosb stosb
@ -878,37 +869,30 @@ enum_associations_callback:
jnz @b jnz @b
.ret: .ret:
mov al, 1 mov al, 1
ret 12 ret 16
.err: .err:
mov ecx, edx mov ecx, edx
call pgfree call pgfree
xor eax, eax xor eax, eax
ret 12 ret 16
enum_plugins_callback: enum_plugins_callback:
; LongBool __stdcall callback(f_name,sec_name,key_name); ; LongBool __stdcall callback(f_name,sec_name,key_name,key_value);
; [esp+4] = f_name, [esp+8] = sec_name, [esp+12] = key_name ; [esp+4] = f_name, [esp+8] = sec_name, [esp+12] = key_name, [esp+16] = key_value
push nullstr mov esi, [esp+16]
push 1024
push saved_file_name
push dword [esp+12+12]
push dword [esp+16+8]
push dword [esp+20+4]
call [ini.get_str]
test eax, eax
jnz .ret
mov esi, saved_file_name
cmp byte [esi], '/' cmp byte [esi], '/'
jz .absolute jz .absolute
; convert path to absolute ; convert path to absolute
mov edi, execdata mov edi, execdata
push esi
@@: @@:
cmp edi, execdata+1024
jae .overflow
lodsb lodsb
stosb stosb
test al, al test al, al
jnz @b jnz @b
pop edi mov edi, saved_file_name
mov [esp+16], edi
mov esi, app_path mov esi, app_path
push esi push esi
xor ecx, ecx xor ecx, ecx
@ -923,6 +907,11 @@ enum_plugins_callback:
@@: @@:
pop esi pop esi
sub ecx, esi sub ecx, esi
push edi
add edi, ecx
cmp edi, saved_file_name+1024
pop edi
ja .overflow
rep movsb rep movsb
mov esi, execdata mov esi, execdata
.z: .z:
@ -948,18 +937,20 @@ enum_plugins_callback:
jnz @b jnz @b
jmp .z jmp .z
.c: .c:
cmp edi, saved_file_name+1024
jae .overflow
lodsb lodsb
stosb stosb
test al, al test al, al
jz @f jnz .c
cmp edi, saved_file_name+1024 jmp .absolute
jb .c .overflow:
mov esi, execdata mov esi, execdata
mov byte [esi+1023], 0
call load_dll_and_import.big call load_dll_and_import.big
.ret: .ret:
mov al, 1 mov al, 1
ret 12 ret 12
@@:
.absolute: .absolute:
; allocate space for plugin info ; allocate space for plugin info
mov eax, [num_plugins] mov eax, [num_plugins]
@ -985,7 +976,7 @@ enum_plugins_callback:
lea esi, [esi+ecx-PluginInfo.size] lea esi, [esi+ecx-PluginInfo.size]
; load plugin DLL ; load plugin DLL
or ebp, -1 or ebp, -1
mov eax, saved_file_name mov eax, [esp+16]
call load_dll_and_import.do call load_dll_and_import.do
test eax, eax test eax, eax
jnz .dec_ret jnz .dec_ret
@ -1004,7 +995,7 @@ MAX_INTERFACE_VER = 3
@@: @@:
push aIncompatibleVersion push aIncompatibleVersion
.cantload: .cantload:
push saved_file_name push dword [esp+4+16]
push aCannotLoadPlugin push aCannotLoadPlugin
mov eax, esp mov eax, esp
push ContinueBtn push ContinueBtn
@ -1041,7 +1032,7 @@ MAX_INTERFACE_VER = 3
jmp .cantload jmp .cantload
.ok: .ok:
mov al, 1 mov al, 1
ret 12 ret 16
plugin_unload_default: plugin_unload_default:
ret ret
@ -6384,13 +6375,13 @@ match_single_mask_rev_lowercase:
mov al, [esi] mov al, [esi]
cmp al, '*' cmp al, '*'
jz .asterisk jz .asterisk
cmp al, '?'
jz .quest
cmp al, ']'
jz .list
dec edi dec edi
cmp edi, edx cmp edi, edx
jb .done_fail jb .done_fail
cmp al, '?'
jz .mask_symbol
cmp al, ']'
jz .list_check
cmp al, [edi] cmp al, [edi]
jz .mask_symbol jz .mask_symbol
.done_fail: .done_fail:
@ -6404,15 +6395,6 @@ match_single_mask_rev_lowercase:
clc clc
pop eax edi esi pop eax edi esi
ret ret
.quest:
dec edi
cmp edi, edx
jb .done_fail
jmp .mask_symbol
.list:
dec edi
cmp edi, edx
jb .done_fail
.list_check: .list_check:
dec esi dec esi
cmp esi, ecx cmp esi, ecx
@ -6450,6 +6432,7 @@ match_single_mask_rev_lowercase:
cmp edi, edx cmp edi, edx
jz .done_fail jz .done_fail
dec esi dec esi
dec edi
jmp .asterisk jmp .asterisk
@@: @@:
cmp byte [esi-1], ']' cmp byte [esi-1], ']'
@ -6458,14 +6441,12 @@ match_single_mask_rev_lowercase:
.asterisk_normal: .asterisk_normal:
mov al, [esi-1] mov al, [esi-1]
@@: @@:
dec edi
cmp edi, edx cmp edi, edx
jz .done_fail jb .done_fail
cmp al, [edi] cmp al, [edi]
jz @f jnz @b
dec edi
jmp @b
@@: @@:
dec edi
dec esi dec esi
call match_single_mask_rev_lowercase call match_single_mask_rev_lowercase
jnc .done_succ jnc .done_succ