diff --git a/faugus_launcher.py b/faugus_launcher.py index 90a23ae..de8b3ce 100644 --- a/faugus_launcher.py +++ b/faugus_launcher.py @@ -240,10 +240,11 @@ except FileNotFoundError: globals()['_'] = gettext.gettext def format_title(title): - title_formatted = re.sub(r'[^a-zA-Z0-9\s]', '', title) - title_formatted = title_formatted.replace(' ', '-') - title_formatted = '-'.join(title_formatted.lower().split()) - return title_formatted + title = title.strip().lower() + title = re.sub(r"['’]", "", title) + title = re.sub(r"[^a-z0-9]+", "-", title) + title = title.strip("-") + return title class ConfigManager: def __init__(self): diff --git a/faugus_run.py b/faugus_run.py index 4f9244d..1540e80 100644 --- a/faugus_run.py +++ b/faugus_run.py @@ -14,6 +14,7 @@ import gettext import locale import json import time +import shlex class PathManager: @staticmethod @@ -822,13 +823,13 @@ def build_launch_command(game): if runner == "Linux-Native": command_parts.append('UMU_NO_PROTON=1') elif runner == "Proton-CachyOS": - command_parts.append(f"WINEPREFIX='{prefix}'") + command_parts.append(f"WINEPREFIX={shlex.quote(prefix)}") command_parts.append(f"PROTONPATH={proton_cachyos}") else: - command_parts.append(f"WINEPREFIX='{prefix}'") + command_parts.append(f"WINEPREFIX={shlex.quote(prefix)}") command_parts.append(f"PROTONPATH={runner}") else: - command_parts.append(f"WINEPREFIX='{prefix}'") + command_parts.append(f"WINEPREFIX={shlex.quote(prefix)}") if gamemode: command_parts.append(gamemode) if launch_arguments: @@ -847,9 +848,9 @@ def build_launch_command(game): command_parts.append(f"'{umu_run}'") if addapp_checkbox == "addapp_enabled": - command_parts.append(f"'{addapp_bat}'") + command_parts.append(shlex.quote(addapp_bat)) else: - command_parts.append(f"'{path}'") + command_parts.append(shlex.quote(path)) if game_arguments: command_parts.append(game_arguments)