deater / dos33fsprogs

Tools for manipulating Apple II dos33 filesystems
http://www.deater.net/weave/vmwprod/apple/dos33fs.html
Other
142 stars 23 forks source link

dos33 DELETE has been broken for a long time #11

Closed 0cjs closed 3 years ago

0cjs commented 3 years ago

Last time I was using this program, perhaps half a year ago, my script to build a disk was working just fine; I recently tried to do that build again and it failed with a complaint about the diskette image having no free space when I tried to write a file. After a bit of debugging, the issue seems to be the dos33 DELETE command: if I simply overwrite an existing file rather than deleting it and writing a new one, things continue to work.

I've reproduced this problem on x86_64 running Debian 9 and Debian 11.

The problem is easily reproduced using an image from this repo. Download EMPTY-DOS33-48K-V254.dsk image and simply run dos33 $img DELETE HELLO followed by dos33 $img CATALOG and you'll see that the image has been corrupted. Here's the output of CATALOG of the above image from before and after the DELETE:

-rw-r----- 1 cjs cjs 143360 Aug 13 19:42 z.dsk

DISK VOLUME 254

 A 002 HELLO

-rw-r----- 1 cjs cjs 143360 Aug 13 19:42 z.dsk

DISK VOLUME 0

 T 000 ^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À^À

I've started looking back through the commits and testing them to see where this broke. It's still broken in commits from a month or more ago.

0cjs commented 3 years ago

I believe I've found the commit that broke things: it's c3a278b7. The previous commit, 8e05dc8b, doesn't exhibit the problem above.

deater commented 3 years ago

thanks for the bug report, it came down to an extra & where there shouldn't have been one.

Should be fixed by 6b5c3612b002a26e083eb55ae1b85064823261ee

0cjs commented 3 years ago

I've confirmed that this fixes it for me. Thanks.