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:
Henrik Rydgård committed 2019-02-10 15:55:00 +01:00
1 parent ccfcbc7462
commit 259cb0f128
3 files changed
+22 -2

No files matched your search

+17 -1
View File
@@ -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;
}