http://bugs.winehq.org/show_bug.cgi?id=59550 Bug ID: 59550 Summary: Implement AppDefaults registry toggle for wcmd to sanitize forward slashes in execution paths (Resolves Unreal Engine update scripts) Product: Wine Version: 11.5 Hardware: arm OS: MacOS Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@list.winehq.org Reporter: smcclenahan@gmail.com Created attachment 80605 --> http://bugs.winehq.org/attachment.cgi?id=80605 wcmdmain.c Registry Hook for CmdForgiveSlashes Currently, wcmd strictly parses forward slashes (/) as command switches. When modern cross-platform engines (specifically Unreal Engine 4/5, e.g., Borderlands 4) attempt to launch background update scripts via cmd.exe /c, they frequently pass un-sanitized, mixed-slash paths (e.g., C:/users/.../PersistentDownloadDir/GbxRelaunch.bat). Because wcmd evaluates the slash as an invalid switch (e.g., /users), the execution fails instantly with an unrecognized command error. This breaks automatic game restarts and hotfix pipelines for numerous titles. (See attached terminal_output.txt for the exact error). Proposed Solution: Introduce an opt-in registry toggle within the AppDefaults hive that allows wcmd to sanitize forward slashes to backslashes for specific calling executables before parsing. * Registry Key: HKCU\Software\Wine\AppDefaults\[CallingProcess.exe] * Proposed Value: "CmdForgiveSlashes"="1" (String or DWORD) * Behavior: When wcmd is spawned, it checks the AppDefaults of the parent process. If the flag is present, a lightweight sanitization routine converts / to \ in the execution buffer before the standard wcmd parsing logic takes over. Architectural Rationale & Preempting Regressions: * Zero Regression Blast Radius: By defaulting to strict legacy parsing and requiring an explicit AppDefaults override, there is zero risk to legacy enterprise scripts, background redistributables, or unrelated software within the same WINEPREFIX. The execution state remains entirely deterministic. * Avoiding Hardcoded Hacks: This prevents the need to continuously merge game-specific string exceptions into the core wcmdmain.c codebase as new games release. * Empowering Downstream Wrappers: Native Windows cmd.exe occasionally relies on undocumented, dynamic heuristics to successfully execute these mixed-slash paths. Perfectly cloning those undocumented heuristics in wcmd is dangerous for legacy stability. Exposing this registry hook gives downstream maintainers (like Proton and CrossOver) a safe, standardized way to configure the environment via their own application profiles without patching Wine's core C code. (Proof of concept patch attached as wcmd_forgive_slashes.patch) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.