瀏覽代碼

Fixed string comparison (thanks @meyraud705!)

Sam Lantinga 1 年之前
父節點
當前提交
13933222ee
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/video/SDL_video.c

+ 2 - 2
src/video/SDL_video.c

@@ -4798,7 +4798,7 @@ void SDL_StartTextInput(void)
 
 
     /* Show the on-screen keyboard, if desired */
     /* Show the on-screen keyboard, if desired */
     const char *hint = SDL_GetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD);
     const char *hint = SDL_GetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD);
-    if (((!hint || SDL_strcasecmp(hint, "auto")) && !SDL_HasKeyboard()) ||
+    if (((!hint || SDL_strcasecmp(hint, "auto") == 0) && !SDL_HasKeyboard()) ||
         SDL_GetStringBoolean(hint, SDL_FALSE)) {
         SDL_GetStringBoolean(hint, SDL_FALSE)) {
         SDL_Window *window = SDL_GetKeyboardFocus();
         SDL_Window *window = SDL_GetKeyboardFocus();
         if (window && _this->ShowScreenKeyboard) {
         if (window && _this->ShowScreenKeyboard) {
@@ -4847,7 +4847,7 @@ void SDL_StopTextInput(void)
 
 
     /* Hide the on-screen keyboard, if desired */
     /* Hide the on-screen keyboard, if desired */
     const char *hint = SDL_GetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD);
     const char *hint = SDL_GetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD);
-    if (((!hint || SDL_strcasecmp(hint, "auto")) && !SDL_HasKeyboard()) ||
+    if (((!hint || SDL_strcasecmp(hint, "auto") == 0) && !SDL_HasKeyboard()) ||
         SDL_GetStringBoolean(hint, SDL_FALSE)) {
         SDL_GetStringBoolean(hint, SDL_FALSE)) {
         SDL_Window *window = SDL_GetKeyboardFocus();
         SDL_Window *window = SDL_GetKeyboardFocus();
         if (window && _this->HideScreenKeyboard) {
         if (window && _this->HideScreenKeyboard) {