diff options
author | 2009-02-05 10:27:43 -0500 | |
---|---|---|
committer | 2009-02-05 10:27:43 -0500 | |
commit | d1a5a7b5699c5533bc89b31a2c281334acf574f4 (patch) | |
tree | c42e1f2f5658273fbbc1cda7db1da61fb4280924 /src | |
parent | da7eea23c7060f609c8636de6b0d64f13d7c2674 (diff) | |
download | textadept-d1a5a7b5699c5533bc89b31a2c281334acf574f4.tar.gz textadept-d1a5a7b5699c5533bc89b31a2c281334acf574f4.zip |
Handle an empty clipboard properly; src/lua_interface.c
Diffstat (limited to 'src')
-rw-r--r-- | src/lua_interface.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lua_interface.c b/src/lua_interface.c index 443c7a9d..677e9709 100644 --- a/src/lua_interface.c +++ b/src/lua_interface.c @@ -1203,8 +1203,10 @@ static int l_ta_mt_index(lua_State *lua) { else if (streq(key, "clipboard_text")) { char *text = gtk_clipboard_wait_for_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD)); - if (text) lua_pushstring(lua, text); - g_free(text); + if (text) { + lua_pushstring(lua, text); + g_free(text); + } else lua_pushstring(lua, ""); } else if (streq(key, "size")) { lua_newtable(lua); int width, height; |