Case insensitive.

This commit is contained in:
Nicholas Marriott 2007-10-12 12:11:40 +00:00
parent 7ec5be30df
commit 46d318e3ef

View File

@ -1,4 +1,4 @@
/* $Id: cmd-set-option.c,v 1.5 2007-10-12 12:08:51 nicm Exp $ */
/* $Id: cmd-set-option.c,v 1.6 2007-10-12 12:11:40 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -107,11 +107,11 @@ cmd_set_option_exec(void *ptr, unused struct cmd_ctx *ctx)
number = strtonum(data->value, 0, UINT_MAX, &errstr);
bool = -1;
if (number == 1 || strcmp(data->value, "on") == 0 ||
strcmp(data->value, "yes") == 0)
if (number == 1 || strcasecmp(data->value, "on") == 0 ||
strcasecmp(data->value, "yes") == 0)
bool = 1;
if (number == 0 || strcmp(data->value, "off") == 0 ||
strcmp(data->value, "no") == 0)
else if (number == 0 || strcasecmp(data->value, "off") == 0 ||
strcasecmp(data->value, "no") == 0)
bool = 0;
} else
bool = 1;