Fixed bug with opening PRG filenames longer than 13 characters eg portal_v1_pa.prg

This commit is contained in:
Stephen White 2018-12-03 19:38:09 +11:00
parent db643e8d0e
commit 7eccc56eda
1 changed files with 3 additions and 2 deletions

View File

@ -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++ = '*';