Commit 7eb13c21c6d5e769f7902ee773df2c1b0a806ff0

pionere 2022-08-10T02:27:25

improve behavior of SDL_SetHint(WithPriority) (#5309)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/SDL_hints.c b/src/SDL_hints.c
index 96869f6..423851a 100644
--- a/src/SDL_hints.c
+++ b/src/SDL_hints.c
@@ -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;