summaryrefslogtreecommitdiff
path: root/expr.c
diff options
context:
space:
mode:
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)) {