On Fri, Mar 11, 2011 at 03:13:54PM -0800, Jason Gerecke wrote: > We remove the case sensitivity requirement for off/on and also > allow the use of "true" and "false" > > Signed-off-by: Jason Gerecke <killert...@gmail.com> > --- > tools/xsetwacom.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c > index ee353fa..d867982 100644 > --- a/tools/xsetwacom.c > +++ b/tools/xsetwacom.c > @@ -1431,7 +1431,7 @@ error: > /** > * Performs intelligent string->int conversion. In addition to converting > strings > * of digits into their corresponding integer values, it converts special > string > - * constants such as "off" (0) and "on" (1). > + * constants such as "off" or "false" (0) and "on" or "true" (1). > * > * The caller is expected to allocate and free memory for return_value. > * > @@ -1444,9 +1444,9 @@ static Bool convert_value_from_user(param_t *param, > char *value, int *return_val > { > if (param->prop_flags & PROP_FLAG_BOOLEAN) > { > - if (strcmp(value, "off") == 0) > + if (strcasecmp(value, "off") == 0 || strcasecmp(value, "false") > == 0) > *return_value = 0; > - else if (strcmp(value, "on") == 0) > + else if (strcasecmp(value, "on") == 0 || strcasecmp(value, > "true") == 0) > *return_value = 1; > else > return False; > -- > 1.7.1
Reviewed-by: Peter Hutterer <peter.hutte...@who-t.net> Cheers, Peter ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel