Commit c391bdc1607de896a0f0b577e2b4a57e5f5740b7

Ryan C. Gordon 2022-06-06T09:31:35

SDL_SetHintWithPriority: better test if hint value has changed.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/SDL_hints.c b/src/SDL_hints.c
index 35eff7a..4629923 100644
--- a/src/SDL_hints.c
+++ b/src/SDL_hints.c
@@ -66,7 +66,7 @@ SDL_SetHintWithPriority(const char *name, const char *value,
             if (priority < hint->priority) {
                 return SDL_FALSE;
             }
-            if (!hint->value || !value || SDL_strcmp(hint->value, value) != 0) {
+            if ( ((hint->value == NULL) != (value == NULL)) || (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;