From b8b270a91e3b9759f43309ce1367ceff56870707 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 29 Feb 2016 11:13:58 +0100 Subject: [PATCH] Make xrdb_get_value() behave as documented The documentation states that this function returns nil if the property does not exist, but it actually returned nothing. And yes, in Lua this is a difference... --- xrdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xrdb.c b/xrdb.c index af393145c..2c4002739 100644 --- a/xrdb.c +++ b/xrdb.c @@ -65,14 +65,14 @@ int luaA_xrdb_get_value(lua_State *L) { &resource_type, &resource_value); if (resource_code && (strcmp(resource_type, "String") == 0)) { lua_pushstring(L, (char *)resource_value.addr); - return 1; } else { if (strlen(resource_class)) luaA_warn(L, "Failed to get xrdb value '%s' (class '%s').", resource_name, resource_class); else luaA_warn(L, "Failed to get xrdb value '%s'.", resource_name); - return 0; + lua_pushnil(L); } + return 1; } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80