mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-28 08:43:38 +01:00
Fix issue where too long filenames could wreck the Install Zip dialog layout.
Well, technically just shortens the path to avoid the issue.
This commit is contained in:
1 parent
ccfcbc7462
commit
259cb0f128
3 files changed
+22
-2
No files matched your search
+17
-1
@@ -95,4 +95,20 @@ bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _
|
||||
*_pExtension = full_path.substr(fname_end);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetFilenameFromPath(std::string full_path) {
|
||||
size_t pos;
|
||||
#ifdef _WIN32
|
||||
pos = full_path.rfind('\\');
|
||||
if (pos != std::string::npos) {
|
||||
return full_path.substr(pos + 1);
|
||||
}
|
||||
#endif
|
||||
pos = full_path.rfind('/');
|
||||
if (pos != std::string::npos) {
|
||||
return full_path.substr(pos + 1);
|
||||
}
|
||||
// No directory components, just return the full path.
|
||||
return full_path;
|
||||
}
|
||||
Reference in new issue
Block a user