diff --git a/source/common/filesystem/filesystem.cpp b/source/common/filesystem/filesystem.cpp index c57b06113..7fd559502 100644 --- a/source/common/filesystem/filesystem.cpp +++ b/source/common/filesystem/filesystem.cpp @@ -1446,7 +1446,7 @@ const char *FileSystem::GetResourceFileName (int rfnum) const noexcept name = Files[rfnum]->FileName; slash = strrchr (name, '/'); - return slash != NULL ? slash+1 : name; + return (slash != NULL && slash[1] != 0) ? slash+1 : name; } //========================================================================== diff --git a/source/core/mapinfo.cpp b/source/core/mapinfo.cpp index ef8ddbd60..25cce2d53 100644 --- a/source/core/mapinfo.cpp +++ b/source/core/mapinfo.cpp @@ -55,7 +55,16 @@ CCMD(listmaps) { for (unsigned int i = 0; i < numUsedSlots; i++) { - Printf("%s - %s\n", mapList[i].fileName.GetChars(), mapList[i].DisplayName()); + int lump = fileSystem.FindFile(mapList[i].fileName); + if (lump >= 0) + { + int rfnum = fileSystem.GetFileContainer(lump); + Printf("%s - %s (%s)\n", mapList[i].fileName.GetChars(), mapList[i].DisplayName(), fileSystem.GetResourceFileName(rfnum)); + } + else + { + Printf("%s - %s (defined but does not exist)\n", mapList[i].fileName.GetChars(), mapList[i].DisplayName()); + } } }