Skip to content

Commit 94dac6b

Browse files
authored
Prevent Bad Preset Names by Tuning Allowed Characters (#6800)
On current master players have the ability to name their control preset `...` which creates issues with Windows. This 1-line PR allows that the only non-alphanumeric characters allowed in the control preset name are `-` or `_`. Tested and works as expected.
1 parent 11a33fe commit 94dac6b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

code/controlconfig/controlsconfig.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,8 @@ bool control_config_accept(bool API_Access)
12981298
cstr = popup_input(flags,
12991299
XSTR( "Confirm new custom preset name.\n\nThe name must not be empty or a default preset.\n\n Press [Enter] to accept, [Esc] to abort to config menu.", 1867),
13001300
32 - 6,
1301-
default_string.c_str());
1301+
default_string.c_str(),
1302+
"-_");
13021303
if (cstr == nullptr) {
13031304
// Abort
13041305
gamesnd_play_iface(InterfaceSounds::USER_SELECT);

0 commit comments

Comments
 (0)