Fixed major issue in libini (set_* affected) connected with wrong parameters to file.seek

Commented out wildcards test from test001 (function is no longer exported thus can't be tested)

git-svn-id: svn://kolibrios.org@919 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Mihail Semenyako (mike.dld) 2008-11-11 20:05:59 +00:00
parent 5847ff53fc
commit 1af612e4d2
3 changed files with 19 additions and 18 deletions

View File

@ -137,6 +137,7 @@ START:
or eax,eax
jnz exit
@^ ; commenting out, file.aux.match_wildcard is no longer exported
mov esi,_str1 + 4
mov edi,_str2 + 4
mov ecx,_str3
@ -152,6 +153,7 @@ START:
add ecx,4
cmp dword[esi-4],0
jnz @b
^@
invoke ini.set_int,s_ini,s_sec,s_key1,100
invoke ini.set_int,s_ini,s_sec,s_key2,101
@ -382,7 +384,7 @@ import libini, \
ini.enum_keys,'ini.enum_keys'
import libio, \
file.aux.match_wildcard,'file.aux.match_wildcard',\
\; file.aux.match_wildcard,'file.aux.match_wildcard',\
file.find_first,'file.find_first',\
file.find_next,'file.find_next',\
file.find_close,'file.find_close',\

View File

@ -102,7 +102,7 @@ endl
lea ebx, [f]
mov [f_addr], ebx
invoke file.seek, [f.fh], SEEK_SET, 0
invoke file.seek, [f.fh], 0, SEEK_SET
stdcall libini._.preload_block, [f_addr]
.next_section:
@ -382,7 +382,6 @@ endl
jnz .create_key
.modify_key:
stdcall libini._.get_value_length, [f_addr]
sub eax, [_buf_len]
stdcall libini._.shift_content, [f_addr], eax
@ -391,7 +390,7 @@ endl
invoke file.tell, [f.fh]
sub eax, [f.cnt]
; dec eax
invoke file.seek, [f.fh], SEEK_SET, eax
invoke file.seek, [f.fh], eax, SEEK_SET
invoke file.write, [f.fh], [_buffer], [_buf_len]
pop edi esi ebx

View File

@ -176,7 +176,7 @@ proc libini._.unload_block _f ;/////////////////////////////////////////////////
mov ebx, [_f]
mov eax, [ebx + IniFile.pos]
add eax, -ini.BLOCK_SIZE
invoke file.seek, [ebx + IniFile.fh], SEEK_SET, eax
invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET
stdcall libini._.preload_block, ebx
add esi, eax ; ini.BLOCK_SIZE
mov [ebx + IniFile.cnt], 0
@ -228,7 +228,7 @@ proc libini._.reload_block _f ;/////////////////////////////////////////////////
mov ebx, [_f]
push [ebx + IniFile.bsize]
push esi [ebx + IniFile.cnt]
invoke file.seek, [ebx + IniFile.fh], SEEK_SET, [ebx + IniFile.pos]
invoke file.seek, [ebx + IniFile.fh], [ebx + IniFile.pos], SEEK_SET
stdcall libini._.preload_block, ebx
pop [ebx + IniFile.cnt] esi
pop eax
@ -276,8 +276,8 @@ endl
; push eax
sub eax, ecx
; dec eax
invoke file.seek, ebx, SEEK_SET, eax
@@: invoke file.seek, ebx, SEEK_CUR, [_delta]
invoke file.seek, ebx, eax, SEEK_SET
@@: invoke file.seek, ebx, [_delta], SEEK_CUR
invoke file.eof?, ebx
or eax, eax
jnz .done
@ -286,13 +286,13 @@ endl
mov eax, [_delta]
neg eax
sub eax, ecx;ini.BLOCK_SIZE
invoke file.seek,ebx,SEEK_CUR,eax
invoke file.seek, ebx, eax, SEEK_CUR
invoke file.write, ebx, [buf], ecx;ini.BLOCK_SIZE
jmp @b
.done:
mov eax, [_delta]
neg eax
invoke file.seek, ebx, SEEK_CUR, eax
invoke file.seek, ebx, eax, SEEK_CUR
invoke file.seteof, ebx
; pop eax
; invoke file.seek, ebx, SEEK_SET;, eax
@ -317,7 +317,7 @@ endl
sub eax, ecx
lea edx, [eax - 1]
push edx
@@: invoke file.seek, ebx, SEEK_SET, edx
@@: invoke file.seek, ebx, edx, SEEK_SET
invoke file.eof?, ebx
or eax, eax
jnz @f
@ -328,12 +328,12 @@ endl
add edx, -ini.BLOCK_SIZE
cmp edx, [esp]
jl @f
invoke file.seek, ebx, SEEK_SET, edx
invoke file.seek, ebx, edx, SEEK_SET
invoke file.read, ebx, [buf], ini.BLOCK_SIZE
mov ecx, eax
mov eax, [_delta]
sub eax, ecx
invoke file.seek, ebx, SEEK_CUR, eax
invoke file.seek, ebx, eax, SEEK_CUR
invoke file.write, ebx, [buf], ecx
jmp @b
@@:
@ -372,8 +372,8 @@ proc libini._.get_value_length _f ;/////////////////////////////////////////////
sub eax, edx
mov [esp + 4 * 3], eax
; pop eax
invoke file.seek, [ebx + IniFile.fh], SEEK_SET;, eax
pop eax
invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET
stdcall libini._.preload_block, [_f]
pop [ebx + IniFile.cnt] esi
pop eax edx ecx ebx
@ -442,7 +442,7 @@ proc libini._.find_section _f, _sec_name ;//////////////////////////////////////
push ebx edi
mov ecx, [_f]
invoke file.seek, [ecx + IniFile.fh], SEEK_SET, 0
invoke file.seek, [ecx + IniFile.fh], 0, SEEK_SET
stdcall libini._.preload_block, [_f]
.next_section: