summaryrefslogtreecommitdiff
path: root/expr.c
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:13 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:13 +0000
commit37ebbbe7b11febaf548006a9b73db0eebf79881a (patch)
tree61b33bfceb94acec99084a416397d2838018b160 /expr.c
parent287ac4c6af61d8f9f95cd3b3219c979e1329a2fe (diff)
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_901xf86-4_3_99_16
Diffstat (limited to 'expr.c')
-rw-r--r--expr.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/expr.c b/expr.c
index 2b98266..f48bcb9 100644
--- a/expr.c
+++ b/expr.c
@@ -24,7 +24,7 @@
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/programs/xkbcomp/expr.c,v 3.6 2002/06/05 00:00:37 dawes Exp $ */
+/* $XFree86: xc/programs/xkbcomp/expr.c,v 3.7 2003/08/06 14:04:05 eich Exp $ */
#include "xkbcomp.h"
#include "tokens.h"
@@ -569,9 +569,16 @@ ExprDef *left,*right;
if (expr->type==TypeString) {
register char *str;
str= XkbAtomGetString(NULL,expr->value.str);
- if ((str!=None)&&(strlen(str)==1)) {
- val_rtrn->uval= str[0];
- return True;
+ if (str!=None)
+ switch (strlen(str)) {
+ case 0:
+ val_rtrn->uval= 0;
+ return True;
+ case 1:
+ val_rtrn->uval= str[0];
+ return True;
+ default:
+ break;
}
}
if ((expr->type!=TypeInt)&&(expr->type!=TypeFloat)) {