[grilo-plugins] lua-factory: fix types in lua-json



commit 7c7d4d82f6a05d50802f30de8ddb4afcc84bbab6
Author: Victor Toso <me victortoso com>
Date:   Thu Sep 24 17:50:39 2015 +0200

    lua-factory: fix types in lua-json
    
    If we lua_pushnumber instead of lua_pushboolean, the result would be an
    integer instead of boolean. When this is converted to media keys, it
    fails with:
    
    grl-lua-library.c:394: 'number' is not compatible for 'favourite'
    
    https://bugzilla.gnome.org/show_bug.cgi?id=755447

 src/lua-factory/lua-library/lua-json.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/lua-factory/lua-library/lua-json.c b/src/lua-factory/lua-library/lua-json.c
index 1424c2e..d22ee3b 100644
--- a/src/lua-factory/lua-library/lua-json.c
+++ b/src/lua-factory/lua-library/lua-json.c
@@ -101,7 +101,7 @@ build_table_from_json_reader (lua_State *L,
         lua_pushnumber (L, json_reader_get_double_value (reader));
         break;
       case G_TYPE_BOOLEAN:
-        lua_pushnumber (L, json_reader_get_boolean_value (reader));
+        lua_pushboolean (L, json_reader_get_boolean_value (reader));
         break;
       default:
         GRL_DEBUG ("'%d' (json-node-type) is not being handled",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]