Skip to content

mod_EmuELEC: also clear oversized sdl_controllerconfig for ports calling get_controls before sourcing - #358

Merged
kloptops merged 2 commits into
PortsMaster:mainfrom
worstcase-scenario:main
Oct 23, 2026
Merged

kloptops merged 2 commits into
PortsMaster:mainfrom
worstcase-scenario:main

Conversation

@worstcase-scenario

Copy link
Copy Markdown
Contributor

The existing E2BIG fix wraps get_controls, but the wrapper is only installed if the mod file is sourced before get_controls runs. Several ports (e.g. Sonic 1, Sonic 2, Sonic CD) call get_controls first and source mod_${CFW_NAME}.txt afterwards. In that case sdl_controllerconfig still holds the full gamecontrollerdb, gets exported as SDL_GAMECONTROLLERCONFIG, and every execve() fails with “Argument list too long”.

This adds a one-line check right after the wrapper that clears the variable when it is already oversized at source time. Both call orders are now covered, and SDL still receives the mappings via SDL_GAMECONTROLLERCONFIG_FILE.

…ing get_controls before sourcing

The existing E2BIG fix wraps get_controls, but the wrapper is only installed if the mod file is sourced before get_controls runs. Several ports (e.g. Sonic 1, Sonic 2, Sonic CD) call get_controls first and source mod_${CFW_NAME}.txt afterwards. In that case sdl_controllerconfig still holds the full gamecontrollerdb, gets exported as SDL_GAMECONTROLLERCONFIG, and every execve() fails with “Argument list too long”.

This adds a one-line check right after the wrapper that clears the variable when it is already oversized at source time. Both call orders are now covered, and SDL still receives the mappings via SDL_GAMECONTROLLERCONFIG_FILE.
@kloptops
kloptops merged commit c6d864d into PortsMaster:main Oct 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants