From c80e81c2dc3f71664a9f9e69903331adce300488 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 16 Dec 2022 22:37:32 +0100 Subject: [PATCH] (Linux) Fixed a .desktop file parsing issue where escaped % characters were not handled correctly. --- es-app/src/FileData.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/es-app/src/FileData.cpp b/es-app/src/FileData.cpp index dea180154..da3876dbd 100644 --- a/es-app/src/FileData.cpp +++ b/es-app/src/FileData.cpp @@ -1440,6 +1440,9 @@ void FileData::launchGame() } #else if (isShortcut) { + // Note that the following is not an attempt to implement the entire FreeDesktop standard + // for .desktop files, for example argument parsing is not really usable in this context. + // There's essentially only enough functionality here to be able to run games and emulators. if (Utils::FileSystem::exists(Utils::String::replace(romPath, "\\", "")) && !Utils::FileSystem::isDirectory(Utils::String::replace(romPath, "\\", ""))) { LOG(LogInfo) << "Parsing desktop file \"" << Utils::String::replace(romPath, "\\", "") @@ -1464,6 +1467,7 @@ void FileData::launchGame() romPath = Utils::String::replace(romPath, "%f", ""); romPath = Utils::String::replace(romPath, "%U", ""); romPath = Utils::String::replace(romPath, "%u", ""); + romPath = Utils::String::replace(romPath, "%%", "%"); romPath = Utils::String::trim(romPath); command = Utils::String::replace(command, binaryPath, ""); execEntry = true;