1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-01 09:10:37 +00:00

Fixed LOC function for files

Will correctly return zero (0) now for just opened but yet untouched files.
This commit is contained in:
Roland Heyder 2021-10-22 23:51:48 +02:00
parent a97311bfbc
commit c48bf6776e
2 changed files with 4 additions and 9 deletions

View file

@ -14,10 +14,11 @@
### Linux
--->
<!---
## Fixes
### All platforms
- Function `LOC` used on physical files will correctly return zero (0) now for just opened but yet untouched files.
<!---
### Windows
### macOS

View file

@ -16325,19 +16325,13 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
}
if (gfs->type==1){//RANDOM
return gfs_getpos(i)/gfs->record_length+1;
return gfs_getpos(i)/gfs->record_length;
}
if (gfs->type==2){//BINARY
return gfs_getpos(i);
}
//APPEND/OUTPUT/INPUT
int64 pos;
pos=gfs_getpos(i);
if (!pos) return 1;
pos--;
pos/=128;
pos++;
return pos;
return gfs_getpos(i)/128;
}
qbs *func_input(int32 n,int32 i,int32 passed){