summaryrefslogtreecommitdiff
path: root/expr.c
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:49:11 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:49:11 +0000
commita153e2624e9e3e7b06fad207e8855bea617ac088 (patch)
tree61b33bfceb94acec99084a416397d2838018b160 /expr.c
parentae4c01f83c60e931983c74d6285c6a22e3c33034 (diff)
merge latest (4.3.99.16) from XFree86 (vendor) branch
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)) {