diff options
Diffstat (limited to 'gudev')
-rw-r--r-- | gudev/gudevdevice.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gudev/gudevdevice.c b/gudev/gudevdevice.c index df6ebd1..e14f367 100644 --- a/gudev/gudevdevice.c +++ b/gudev/gudevdevice.c @@ -613,7 +613,7 @@ out: * * Look up the value for @key on @device and convert it to an * boolean. This is done by doing a case-insensitive string comparison - * on the string value against "1" and "true". + * on the string value against "1", "true", "Y" and "y". * * Returns: The value for @key or %FALSE if @key doesn't exist or * isn't a #gboolean. @@ -926,8 +926,12 @@ g_udev_device_get_sysfs_attr_as_boolean (GUdevDevice *device, if (s == NULL) goto out; - if (strcmp (s, "1") == 0 || g_ascii_strcasecmp (s, "true") == 0) + if (strcmp (s, "1") == 0 || + g_ascii_strcasecmp (s, "true") == 0 || + g_ascii_strcasecmp (s, "y") == 0) { result = TRUE; + } + out: return result; } @@ -1141,7 +1145,7 @@ out: * * Look up the sysfs attribute with @name on @device and convert it to an * boolean. This is done by doing a case-insensitive string comparison - * on the string value against "1" and "true". This function does + * on the string value against "1", "true", "Y" and "y". This function does * blocking I/O, and updates the sysfs attributes cache. * * Returns: The value of the sysfs attribute or %FALSE if there is no such |