소스 검색

A hint with an empty string should be treated as the default value

Sam Lantinga 8 년 전
부모
커밋
b3ac0b6fb0
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/SDL_hints.c

+ 1 - 1
src/SDL_hints.c

@@ -122,7 +122,7 @@ SDL_bool
 SDL_GetHintBoolean(const char *name, SDL_bool default_value)
 SDL_GetHintBoolean(const char *name, SDL_bool default_value)
 {
 {
     const char *hint = SDL_GetHint(name);
     const char *hint = SDL_GetHint(name);
-    if (!hint) {
+    if (!hint || !*hint) {
         return default_value;
         return default_value;
     }
     }
     if (*hint == '0' || SDL_strcasecmp(hint, "false") == 0) {
     if (*hint == '0' || SDL_strcasecmp(hint, "false") == 0) {