~vdupras/duskos

15789cfd00ca5eebfc55a02a08eef12e1b1f6ebe — Virgil Dupras 22 days ago a92b09d
fs/fatlo: fix broken FAT :nextsector?

Any direntry that wouldn't be in the first sector of its parent couldn't be
found.
1 files changed, 2 insertions(+), 2 deletions(-)

M fs/fs/fatlo.fs
M fs/fs/fatlo.fs => fs/fs/fatlo.fs +2 -2
@@ 116,7 116,7 @@ r@ reservedseccnt + r> :RootDirSectors + - ;
\ Read next sector if a sequential read is available, else return false.
: :nextsector? ( self -- f ) >r
  r@ bufseccnt if \ still on a sector streak
    r@ bufseccnt 1+ r@ bufseccnt 1- r> :readsector 1
    r@ bufsec 1+ r@ bufseccnt 1- r> :readsector 1
  else \ out of sector, try next cluster
    r@ bufcluster r@ :FAT@ dup r@ :EOC? if rdrop drop 0 else
      dup to r@ bufcluster r@ :FirstSectorOfCluster


@@ 124,7 124,7 @@ r@ reservedseccnt + r> :RootDirSectors + - ;
  then ;

\ Find current fnbuf( in current dir buffer and return a dir entry.
: :findindir ( self -- direntry ) >r
: :findindir ( self -- direntry-or-0 ) >r
  begin
    r@ :buf( begin ( a )
      dup r@ :)buf < while ( a )