Remove trailing slah from remote links before processing

This commit is contained in:
kalaposfos13 2025-05-21 21:42:26 +02:00
parent 8fa7fb3b79
commit bcb35e3bbd
2 changed files with 6 additions and 0 deletions

View File

@ -193,6 +193,9 @@ void Emulator::Run(const std::filesystem::path& file, const std::vector<std::str
std::string remote_url(Common::g_scm_remote_url);
std::string remote_host;
try {
if (*remote_url.rbegin() == '/') {
remote_url.pop_back();
}
remote_host = remote_url.substr(19, remote_url.rfind('/') - 19);
} catch (...) {
remote_host = "unknown";

View File

@ -58,6 +58,9 @@ bool MainWindow::Init() {
std::string remote_url(Common::g_scm_remote_url);
std::string remote_host;
try {
if (*remote_url.rbegin() == '/') {
remote_url.pop_back();
}
remote_host = remote_url.substr(19, remote_url.rfind('/') - 19);
} catch (...) {
remote_host = "unknown";