1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-03-20 03:31:27 +00:00

Fix long standing bug in catalog code

This commit is contained in:
Dave Schmenk 2020-01-17 12:51:19 -08:00
parent 6045b260db
commit ff023f65d2
6 changed files with 30 additions and 36 deletions

@ -70,7 +70,7 @@ export def matchList(pathstr, exp)#2
// Pull out revelant details from the first block
//
entrylen = dirbuf->$23
entriesblk = dirbuf->$24
entriesblk = dirbuf->$24 - 1
entry = entry + entrylen
fin
for i = firstblk to entriesblk

@ -1527,7 +1527,7 @@ def prfiles(optpath)
byte firstblk
byte entrylen, entriesblk
byte i, type, len
word databuff, entry, filecnt
word databuff, entry
if ^optpath
strstripcpy(@path, optpath)
@ -1542,37 +1542,31 @@ def prfiles(optpath)
return perr
fin
firstblk = 1
repeat
if fileio:read(refnum, databuff, 512) == 512
entry = databuff + 4
if firstblk
entrylen = databuff->$23
entriesblk = databuff->$24
filecnt = databuff=>$25
entry = entry + entrylen
fin
for i = firstblk to entriesblk
type = ^entry
if type <> 0
len = type & $0F
^entry = len
puts(entry)
if type & $F0 == $D0 // Is it a directory?
putc('/')
len++
fin
for len = 20 - len downto 1
putc(' ')
next
filecnt--
fin
entry = entry + entrylen
next
firstblk = 0
else
filecnt = 0
while fileio:read(refnum, databuff, 512) == 512
entry = databuff + 4
if firstblk
entrylen = databuff->$23
entriesblk = databuff->$24
entry = entry + entrylen
fin
until filecnt == 0
for i = firstblk to entriesblk
type = ^entry
if type <> 0
len = type & $0F
^entry = len
puts(entry)
if type & $F0 == $D0 // Is it a directory?
putc('/')
len++
fin
for len = 20 - len downto 1
putc(' ')
next
fin
entry = entry + entrylen
next
firstblk = 0
loop
fileio:close(refnum)
heaprelease(databuff)
putln

@ -1186,7 +1186,7 @@ def catalog(path)#0
entry = heap + 4
if firstblk
entrylen = heap->$23
entriesblk = heap->$24
entriesblk = heap->$24 - 1
entry = entry + entrylen
fin
for i = firstblk to entriesblk

@ -1251,7 +1251,7 @@ def catalog(path)#0
entry = heap + 4
if firstblk
entrylen = heap->$23
entriesblk = heap->$24
entriesblk = heap->$24 - 1
entry = entry + entrylen
fin
for i = firstblk to entriesblk

@ -95,7 +95,7 @@ def catalog(path)#0
entry = catptr + 4
if firstblk
entrylen = catptr->$23
entriesblk = catptr->$24
entriesblk = catptr->$24 - 1
entry = entry + entrylen
fin
for i = firstblk to entriesblk

@ -170,7 +170,7 @@ def catalog(path)#0
entry = catptr + 4
if firstblk
entrylen = catptr->$23
entriesblk = catptr->$24
entriesblk = catptr->$24 - 1
entry = entry + entrylen
fin
for i = firstblk to entriesblk