dosemu2 / comcom64

64bit command.com
https://github.com/dosemu2/comcom32/
GNU General Public License v3.0
32 stars 5 forks source link

DIR shows 0 byte(s) free #44

Closed stsp closed 4 years ago

stsp commented 4 years ago

See https://github.com/dosemu2/dosemu2/issues/1317#issuecomment-710700536

andrewbird commented 4 years ago

Seems that full_filespec is lower case, this little patch allows it to show free space (clamped at 2GB)

-  getdfree(full_filespec[0]-'A'+1, &df);
+  getdfree(full_filespec[0]-'a'+1, &df);
stsp commented 4 years ago

Thanks, that's the correct fix.

stsp commented 4 years ago

For me it returns 1Gb though, not 2.

andrewbird commented 4 years ago

Yes, that's the same for me. On my system it's clamped at almost 2GB, but the display is 1GB

>>> 2147450880/1024/1024/1024
1.999969482421875

Is it the sign on the printf format (%15lli)?

andrewbird commented 4 years ago

I rather think it's just truncation, not rounding.

stsp commented 4 years ago

Yep, should now be better.