mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2025-01-05 07:31:08 +00:00
Incorporated John B Matthews correction to file listing algorithm.
This commit is contained in:
parent
6910ae0f45
commit
134141814e
@ -139,6 +139,7 @@ public class PascalFormatDisk extends FormattedDisk {
|
|||||||
/**
|
/**
|
||||||
* Retrieve a list of files.
|
* Retrieve a list of files.
|
||||||
* @see com.webcodepro.applecommander.storage.FormattedDisk#getFiles()
|
* @see com.webcodepro.applecommander.storage.FormattedDisk#getFiles()
|
||||||
|
* @author John B. Matthews (for fixing algorithm)
|
||||||
*/
|
*/
|
||||||
public List getFiles() {
|
public List getFiles() {
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
@ -146,10 +147,10 @@ public class PascalFormatDisk extends FormattedDisk {
|
|||||||
// process directory blocks:
|
// process directory blocks:
|
||||||
int entrySize = ENTRY_SIZE;
|
int entrySize = ENTRY_SIZE;
|
||||||
int offset = entrySize;
|
int offset = entrySize;
|
||||||
while (offset < directory.length) {
|
int count = AppleUtil.getWordValue(directory, 16);
|
||||||
|
for (int i=0; i<count; i++) {
|
||||||
byte[] entry = new byte[entrySize];
|
byte[] entry = new byte[entrySize];
|
||||||
System.arraycopy(directory, offset, entry, 0, entry.length);
|
System.arraycopy(directory, offset, entry, 0, entry.length);
|
||||||
if (entry[6] == 0) break; // at end
|
|
||||||
list.add(new PascalFileEntry(entry, this));
|
list.add(new PascalFileEntry(entry, this));
|
||||||
offset+= entrySize;
|
offset+= entrySize;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user