Fixed a bug where freeSectors and setFileData were not working

appropriately with deleted files (with an initial track of 255).
This commit is contained in:
Robert Greene 2003-03-01 16:04:42 +00:00
parent ec47243efe
commit d83defddc7
1 changed files with 2 additions and 1 deletions

View File

@ -423,7 +423,7 @@ public class DosFormatDisk extends FormattedDisk {
byte[] vtoc = readVtoc();
int track = fileEntry.getTrack();
int sector = fileEntry.getSector();
if (track == 0) {
if (track == 0 || track == 255) {
track = 1;
sector = 0;
while (true) {
@ -493,6 +493,7 @@ public class DosFormatDisk extends FormattedDisk {
protected void freeSectors(DosFileEntry dosFileEntry) {
byte[] vtoc = readVtoc();
int track = dosFileEntry.getTrack();
if (track == 255) return;
int sector = dosFileEntry.getSector();
while (track != 0) {
setSectorFree(track,sector,vtoc);