improve behavior of SDL_SetHint(WithPriority) (#5309)

This commit is contained in:
pionere 2022-08-10 02:27:25 +02:00 committed by GitHub
parent 1db7d33dc4
commit 7eb13c21c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -66,7 +66,8 @@ SDL_SetHintWithPriority(const char *name, const char *value,
if (priority < hint->priority) {
return SDL_FALSE;
}
if (((hint->value == NULL) != (value == NULL)) || (value && (SDL_strcmp(hint->value, value) != 0))) {
if (hint->value != value &&
(!value || !hint->value || SDL_strcmp(hint->value, value) != 0)) {
for (entry = hint->callbacks; entry; ) {
/* Save the next entry in case this one is deleted */
SDL_HintWatch *next = entry->next;