Merge branch 'master' into jgrpp
# Conflicts: # src/console.cpp # src/os/os2/os2.cpp # src/os/unix/font_unix.cpp # src/strgen/strgen.h # src/strgen/strgen_base.cpp # src/table/settings/gui_settings.ini
This commit is contained in:
@@ -270,22 +270,20 @@ int CDECL main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
#ifndef WITH_COCOA
|
||||
bool GetClipboardContents(char *buffer, const char *last)
|
||||
std::optional<std::string> GetClipboardContents()
|
||||
{
|
||||
#ifdef WITH_SDL2
|
||||
if (SDL_HasClipboardText() == SDL_FALSE) {
|
||||
return false;
|
||||
}
|
||||
if (SDL_HasClipboardText() == SDL_FALSE) return std::nullopt;
|
||||
|
||||
char *clip = SDL_GetClipboardText();
|
||||
if (clip != nullptr) {
|
||||
strecpy(buffer, clip, last);
|
||||
std::string result = clip;
|
||||
SDL_free(clip);
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
return std::nullopt;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user