From 9d74ceedfdd759d48a8f74d43895ec78c5d20883 Mon Sep 17 00:00:00 2001 From: Patrick Griffis Date: Fri, 5 Aug 2016 21:08:52 -0400 Subject: python: Fix get_pluginpref() This relied on undocumented behavior of hexchat_pluginpref_get_int() that has been fixed recently. -1 is the correct failure value. --- plugins/python/python.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/python/python.c b/plugins/python/python.c index 34784c3b..88913282 100644 --- a/plugins/python/python.c +++ b/plugins/python/python.c @@ -1849,7 +1849,7 @@ Module_hexchat_pluginpref_get(PyObject *self, PyObject *args) BEGIN_XCHAT_CALLS(NONE); retint = hexchat_pluginpref_get_int(prefph, var); END_XCHAT_CALLS(); - if ((retint == 0) && (strcmp(retstr, "0") != 0)) + if ((retint == -1) && (strcmp(retstr, "-1") != 0)) ret = PyUnicode_FromString(retstr); else ret = PyLong_FromLong(retint); -- cgit 1.4.1