Skip to content

Commit

Permalink
Fixed LOC function for files
Browse files Browse the repository at this point in the history
Will correctly return zero (0) now for just opened but yet untouched files.
  • Loading branch information
RhoSigma-QB64 committed Oct 22, 2021
1 parent a97311b commit c48bf67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 2 additions & 8 deletions internal/c/libqb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down

0 comments on commit c48bf67

Please sign in to comment.