From 7eccc56eda692d1e0b16420d531bc79fb1a284ea Mon Sep 17 00:00:00 2001 From: Stephen White Date: Mon, 3 Dec 2018 19:38:09 +1100 Subject: [PATCH] Fixed bug with opening PRG filenames longer than 13 characters eg portal_v1_pa.prg --- src/iec_commands.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/iec_commands.cpp b/src/iec_commands.cpp index 30bac63..e39a930 100644 --- a/src/iec_commands.cpp +++ b/src/iec_commands.cpp @@ -1482,11 +1482,12 @@ bool IEC_Commands::FindFirst(DIR& dir, const char* matchstr, FILINFO& filInfo) // This basically changes a file name from something like // SOMELONGDISKIMAGENAME.D64 to SOMELONGDISKIMAGENAME*.D64 // so the actual SOMELONGDISKIMAGENAMETHATISWAYTOOLONGFORCBMFILEBROWSERTODISPLAY.D64 will be found. + bool diskImage = DiskImage::IsDiskImageExtention(matchstr); strcpy(pattern, matchstr); - if (strlen(pattern) > 12) + if (strlen(pattern) > CBM_NAME_LENGTH_MINUS_D64) { char* ext = strrchr(matchstr, '.'); - if (ext) + if (ext && diskImage) { char* ptr = strrchr(pattern, '.'); *ptr++ = '*';