summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2014-09-30 13:17:29 +1000
committerskidau <skidau@gmail.com>2014-09-30 13:17:29 +1000
commitda221e3d9c1b8edb09f37f2d5c0b41b2aade07cb (patch)
treeb8361c174616f6206fca6700b3febf5a56463011 /Source/Core
parentb5ebace92e6645b50908c3405626f4a9eb303367 (diff)
parent6026a3f76f88a4c00b616bd16316540d373eeffd (diff)
Merge pull request #1018 from zhuowei/elf_map_basename_only
When loading the map file for a DOL/ELF file, extract only the filename from the DOL/ELF's path
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Boot/Boot.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Core/Core/Boot/Boot.cpp b/Source/Core/Core/Boot/Boot.cpp
index 26814c233f..64e880e7ec 100644
--- a/Source/Core/Core/Boot/Boot.cpp
+++ b/Source/Core/Core/Boot/Boot.cpp
@@ -70,6 +70,7 @@ bool CBoot::FindMapFile(std::string* existing_map_file,
std::string* writable_map_file)
{
std::string title_id_str;
+ size_t name_begin_index;
SCoreStartupParameter& _StartupPara = SConfig::GetInstance().m_LocalCoreStartupParameter;
switch (_StartupPara.m_BootType)
@@ -90,9 +91,14 @@ bool CBoot::FindMapFile(std::string* existing_map_file,
case SCoreStartupParameter::BOOT_ELF:
case SCoreStartupParameter::BOOT_DOL:
- // Strip the .elf/.dol file extension
+ // Strip the .elf/.dol file extension and directories before the name
+ name_begin_index = _StartupPara.m_strFilename.find_last_of("/") + 1;
+ if ((_StartupPara.m_strFilename.find_last_of("\\") + 1) > name_begin_index)
+ {
+ name_begin_index = _StartupPara.m_strFilename.find_last_of("\\") + 1;
+ }
title_id_str = _StartupPara.m_strFilename.substr(
- 0, _StartupPara.m_strFilename.size() - 4);
+ name_begin_index, _StartupPara.m_strFilename.size() - 4 - name_begin_index);
break;
default: