mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-11-21 09:36:24 +00:00
clipboard: SDL_GetClipboardText() now follows the SDL_GetStringRule.
Reference Issue #10229.
This commit is contained in:
@@ -680,14 +680,13 @@ static void CopyMapping(void)
|
||||
static void PasteMapping(void)
|
||||
{
|
||||
if (controller) {
|
||||
char *mapping = SDL_GetClipboardText();
|
||||
const char *mapping = SDL_GetClipboardText();
|
||||
if (MappingHasBindings(mapping)) {
|
||||
StopBinding();
|
||||
SetAndFreeGamepadMapping(mapping);
|
||||
SDL_SetGamepadMapping(controller->id, mapping);
|
||||
RefreshControllerName();
|
||||
} else {
|
||||
/* Not a valid mapping, ignore it */
|
||||
SDL_free(mapping);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -743,7 +742,7 @@ static void CopyControllerName(void)
|
||||
static void PasteControllerName(void)
|
||||
{
|
||||
SDL_free(controller_name);
|
||||
controller_name = SDL_GetClipboardText();
|
||||
controller_name = SDL_strdup(SDL_GetClipboardText());
|
||||
CommitControllerName();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user