diff --git a/CHANGELOG b/CHANGELOG index 969bcfc06c..222ed76a04 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -97,6 +97,10 @@ Next: - Added breakpoint type "Freeze memory" (Enmet) - Implemented seeking in MSCDEX (Imported from dosbox-staging/dosbox-staging#3516 authored by weirddan455) + - Fixed built-in COPY command failed to obtain free space when reported DOS + version is set to 7.1 (maron2000) + - Fixed some file extensions in tbe filter list were ignored in the file open + dialogs (maron2000) 2024.03.01 - If an empty CD-ROM drive is attached to IDE emulation, return "Medium Not diff --git a/src/dos/dos_programs.cpp b/src/dos/dos_programs.cpp index 483e172c98..50b2370534 100644 --- a/src/dos/dos_programs.cpp +++ b/src/dos/dos_programs.cpp @@ -551,7 +551,7 @@ void MenuBrowseCDImage(char drive, int num) { std::string files="", fname=""; const char *lFilterPatterns[] = {"*.iso","*.cue","*.bin","*.chd","*.mdf","*.gog","*.ins","*.ISO","*.CUE","*.BIN","*.CHD","*.MDF","*.GOG","*.INS"}; const char *lFilterDescription = "CD image files (*.iso, *.cue, *.bin, *.chd, *.mdf, *.gog, *.ins)"; - lTheOpenFileName = tinyfd_openFileDialog("Select a CD image file","",14,lFilterPatterns,lFilterDescription,0); + lTheOpenFileName = tinyfd_openFileDialog("Select a CD image file","", sizeof(lFilterPatterns) / sizeof(lFilterPatterns[0]),lFilterPatterns,lFilterDescription,0); if (lTheOpenFileName) { isoDrive *cdrom = dynamic_cast(Drives[drive-'A']); @@ -597,7 +597,7 @@ void MenuBrowseFDImage(char drive, int num, int type) { std::string files="", fname=""; const char *lFilterPatterns[] = {"*.ima","*.img","*.xdf","*.fdi","*.hdm","*.nfd","*.d88","*.IMA","*.IMG","*.XDF","*.FDI","*.HDM","*.NFD","*.D88"}; const char *lFilterDescription = "Floppy image files (*.ima, *.img, *.xdf, *.fdi, *.hdm, *.nfd, *.d88)"; - lTheOpenFileName = tinyfd_openFileDialog("Select a floppy image file","",4,lFilterPatterns,lFilterDescription,0); + lTheOpenFileName = tinyfd_openFileDialog("Select a floppy image file","",sizeof(lFilterPatterns)/sizeof(lFilterPatterns[0]), lFilterPatterns, lFilterDescription, 0); if (lTheOpenFileName) { //uint8_t mediaid = 0xF0; UNUSED @@ -654,12 +654,12 @@ void MenuBrowseImageFile(char drive, bool arc, bool boot, bool multiple) { if (arc) { const char *lFilterPatterns[] = {"*.zip","*.7z","*.ZIP","*.7Z"}; const char *lFilterDescription = "Archive files (*.zip, *.7z)"; - lTheOpenFileName = tinyfd_openFileDialog(("Select an archive file for Drive "+str+":").c_str(),"",4,lFilterPatterns,lFilterDescription,0); + lTheOpenFileName = tinyfd_openFileDialog(("Select an archive file for Drive "+str+":").c_str(),"", sizeof(lFilterPatterns) / sizeof(lFilterPatterns[0]),lFilterPatterns,lFilterDescription,0); if (lTheOpenFileName) fname = GetNewStr(lTheOpenFileName); } else { const char *lFilterPatterns[] = {"*.ima","*.img","*.vhd","*.fdi","*.hdi","*.nfd","*.nhd","*.d88","*.hdm","*.xdf","*.iso","*.cue","*.bin","*.chd","*.mdf","*.gog","*.ins","*.ccd","*.IMA","*.IMG","*.VHD","*.FDI","*.HDI","*.NFD","*.NHD","*.D88","*.HDM","*.XDF","*.ISO","*.CUE","*.BIN","*.CHD","*.MDF","*.GOG","*.INS", "*.CCD"}; const char *lFilterDescription = "Disk/CD image files"; - lTheOpenFileName = tinyfd_openFileDialog(((multiple?"Select image file(s) for Drive ":"Select an image file for Drive ")+str+":").c_str(),"",22,lFilterPatterns,lFilterDescription,multiple?1:0); + lTheOpenFileName = tinyfd_openFileDialog(((multiple?"Select image file(s) for Drive ":"Select an image file for Drive ")+str+":").c_str(),"", sizeof(lFilterPatterns) / sizeof(lFilterPatterns[0]),lFilterPatterns,lFilterDescription,multiple?1:0); if (lTheOpenFileName) fname = GetNewStr(lTheOpenFileName); if (multiple&&fname.size()) { files += "\""; @@ -668,7 +668,7 @@ void MenuBrowseImageFile(char drive, bool arc, bool boot, bool multiple) { files += "\" "; } while (multiple&&lTheOpenFileName&&systemmessagebox("Mount image files","Do you want to mount more image file(s)?","yesno", "question", 1)) { - lTheOpenFileName = tinyfd_openFileDialog(("Select image file(s) for Drive "+str+":").c_str(),"",20,lFilterPatterns,lFilterDescription,multiple?1:0); + lTheOpenFileName = tinyfd_openFileDialog(("Select image file(s) for Drive "+str+":").c_str(),"", sizeof(lFilterPatterns) / sizeof(lFilterPatterns[0]),lFilterPatterns,lFilterDescription,multiple?1:0); if (lTheOpenFileName) { fname = GetNewStr(lTheOpenFileName); files += "\"";