mirror of https://github.com/encounter/SDL.git
SDL_os2video.c: fixed HasClipboardText() semantics.
Empty string in clipboard is expected to give FALSE by SDL_HasClipboardText. Noticed in a commit by josch1710 in bitwiseworks' os/2 fork.
This commit is contained in:
parent
86b7a0642f
commit
3b9e6c1cec
|
@ -1401,18 +1401,17 @@ static char *OS2_GetClipboardText(_THIS)
|
|||
static SDL_bool OS2_HasClipboardText(_THIS)
|
||||
{
|
||||
SDL_VideoData *pVData = (SDL_VideoData *)_this->driverdata;
|
||||
SDL_bool fClipboard;
|
||||
PSZ pszClipboard;
|
||||
|
||||
if (!WinOpenClipbrd(pVData->hab)) {
|
||||
debug_os2("WinOpenClipbrd() failed");
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
fClipboard = ((PSZ)WinQueryClipbrdData(pVData->hab, CF_TEXT) != NULL)?
|
||||
SDL_TRUE : SDL_FALSE;
|
||||
pszClipboard = (PSZ)WinQueryClipbrdData(pVData->hab, CF_TEXT);
|
||||
WinCloseClipbrd(pVData->hab);
|
||||
|
||||
return fClipboard;
|
||||
return (pszClipboard && *pszClipboard) ? SDL_TRUE : SDL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue