From eaf2e289108051d5e9cef8209e837f929036276f Mon Sep 17 00:00:00 2001 From: zilmar Date: Sun, 17 Jan 2016 17:02:46 +1100 Subject: [PATCH] [Project64] Use cpath to get the filename in rom browser --- Source/Project64/UserInterface/RomBrowserClass.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Project64/UserInterface/RomBrowserClass.cpp b/Source/Project64/UserInterface/RomBrowserClass.cpp index 16e99cf14..97f444470 100644 --- a/Source/Project64/UserInterface/RomBrowserClass.cpp +++ b/Source/Project64/UserInterface/RomBrowserClass.cpp @@ -459,8 +459,7 @@ bool CRomBrowser::FillRomInfo(ROM_INFO * pRomInfo) } else { - char drive[_MAX_DRIVE], dir[_MAX_DIR], ext[_MAX_EXT]; - _splitpath(pRomInfo->szFullFileName, drive, dir, pRomInfo->FileName, ext); + strncpy(pRomInfo->FileName, CPath(pRomInfo->szFullFileName).GetNameExtension().c_str(), sizeof(pRomInfo->FileName) / sizeof(pRomInfo->FileName[0])); } if (m_Fields[RB_InternalName].Pos() >= 0) { @@ -1576,9 +1575,9 @@ void CRomBrowser::RomList_SortList(void) } /* - * SaveRomList - save all the rom information about the current roms in the rom brower - * to a cache file, so it is quick to reload the information - */ +* SaveRomList - save all the rom information about the current roms in the rom brower +* to a cache file, so it is quick to reload the information +*/ void CRomBrowser::SaveRomList(strlist & FileList) { MD5 ListHash = RomListHash(FileList);