Reorganized if statement.

This commit is contained in:
TingPing 2012-09-13 02:19:53 -04:00
parent db4b665cd3
commit eace2397e6

View File

@ -1610,9 +1610,10 @@ Module_xchat_pluginpref_get(PyObject *self, PyObject *args)
// This will always return numbers as integers. // This will always return numbers as integers.
retint = xchat_pluginpref_get_int(ph, var); retint = xchat_pluginpref_get_int(ph, var);
if (xchat_pluginpref_get_str(ph, var, retstr)) { if (xchat_pluginpref_get_str(ph, var, retstr)) {
ret = PyInt_FromLong(retint);
if ((retint == 0) && (strcmp(retstr, "0") != 0)) if ((retint == 0) && (strcmp(retstr, "0") != 0))
ret = PyString_FromString(retstr); ret = PyString_FromString(retstr);
else
ret = PyInt_FromLong(retint);
} }
else else
ret = Py_None; ret = Py_None;