Wed Jul 22 08:39:03 2015 UTC ()
adjust a nul-string assignment to avoid const issues.


(mrg)
diff -r1.1.1.3 -r1.2 xsrc/external/mit/xkbcomp/dist/expr.c

cvs diff -r1.1.1.3 -r1.2 xsrc/external/mit/xkbcomp/dist/expr.c (expand / switch to unified diff)

--- xsrc/external/mit/xkbcomp/dist/expr.c 2015/07/22 08:34:46 1.1.1.3
+++ xsrc/external/mit/xkbcomp/dist/expr.c 2015/07/22 08:39:03 1.2
@@ -719,27 +719,28 @@ ExprResolveString(ExprDef * expr, @@ -719,27 +719,28 @@ ExprResolveString(ExprDef * expr,
719 719
720 switch (expr->op) 720 switch (expr->op)
721 { 721 {
722 case ExprValue: 722 case ExprValue:
723 if (expr->type != TypeString) 723 if (expr->type != TypeString)
724 { 724 {
725 ERROR1("Found constant of type %s, expected a string\n", 725 ERROR1("Found constant of type %s, expected a string\n",
726 exprTypeText(expr->type)); 726 exprTypeText(expr->type));
727 return False; 727 return False;
728 } 728 }
729 val_rtrn->str = XkbAtomGetString(NULL, expr->value.str); 729 val_rtrn->str = XkbAtomGetString(NULL, expr->value.str);
730 if (val_rtrn->str == NULL) 730 if (val_rtrn->str == NULL)
731 { 731 {
732 static const char *empty = ""; 732 static char empty_char = '\0';
 733 char *empty = &empty_char;
733 val_rtrn->str = empty; 734 val_rtrn->str = empty;
734 } 735 }
735 return True; 736 return True;
736 case ExprIdent: 737 case ExprIdent:
737 if (lookup) 738 if (lookup)
738 { 739 {
739 ok = (*lookup) (lookupPriv, 740 ok = (*lookup) (lookupPriv,
740 None, expr->value.str, TypeString, val_rtrn); 741 None, expr->value.str, TypeString, val_rtrn);
741 } 742 }
742 if (!ok) 743 if (!ok)
743 ERROR1("Identifier \"%s\" of type string not found\n", 744 ERROR1("Identifier \"%s\" of type string not found\n",
744 XkbAtomText(NULL, expr->value.str, XkbMessage)); 745 XkbAtomText(NULL, expr->value.str, XkbMessage));
745 return ok; 746 return ok;