scanner: Support boolean constants

Aliasing TRUE or FALSE is not very common, but done occasionally
for extra clarity. Namely G_SOURCE_REMOVE / G_SOURCE_CONTINUE are
self-explanatory, unlike the "raw" booleans.

https://bugzilla.gnome.org/show_bug.cgi?id=719566
This commit is contained in:
Florian Müllner 2013-11-29 01:12:40 +01:00
parent 4dfcf7bc21
commit eb6b6f4fd5

View File

@ -1010,10 +1010,10 @@ parse_float_value (const gchar *str)
static gboolean
parse_boolean_value (const gchar *str)
{
if (strcmp (str, "TRUE") == 0)
if (g_ascii_strcasecmp (str, "TRUE") == 0)
return TRUE;
if (strcmp (str, "FALSE") == 0)
if (g_ascii_strcasecmp (str, "FALSE") == 0)
return FALSE;
return parse_int_value (str) ? TRUE : FALSE;