From bec22fe978b41f36e7d9f47480f1fd24d5a23973 Mon Sep 17 00:00:00 2001 From: Yann Droneaud Date: Sun, 9 Oct 2011 17:56:45 +0200 Subject: Return name instead of value in XGetIMValues() and XSetIMValues() As stated in man page (XOpenIM) and Xlib documentation (chapter 13.5.3), XGetIMValues() and XSetImValues() "returns the name of the first argument that could not be obtained." But currently, err = XGetIMValues(im, "invalid", &arg, NULL); returns &arg instead of "invalid". This patch fixes https://bugs.freedesktop.org/show_bug.cgi?id=12897 Signed-off-by: Yann Droneaud Reviewed-by: Jeremy Huddleston Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/imRm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'nx-X11/lib/X11/imRm.c') diff --git a/nx-X11/lib/X11/imRm.c b/nx-X11/lib/X11/imRm.c index 6761bd351..b66bc1421 100644 --- a/nx-X11/lib/X11/imRm.c +++ b/nx-X11/lib/X11/imRm.c @@ -2250,17 +2250,17 @@ _XimSetIMValueData( for(p = values; p->name != NULL; p++) { if(!(res = _XimGetResourceListRec(res_list, list_num, p->name))) { - return p->value; + return p->name; } check = _XimCheckIMMode(res, XIM_SETIMVALUES); if(check == XIM_CHECK_INVALID) { continue; } else if (check == XIM_CHECK_ERROR) { - return p->value; + return p->name; } if(!_XimEncodeLocalIMAttr(res, top, p->value)) { - return p->value; + return p->name; } } return NULL; @@ -2280,17 +2280,17 @@ _XimGetIMValueData( for(p = values; p->name != NULL; p++) { if(!(res = _XimGetResourceListRec(res_list, list_num, p->name))) { - return p->value; + return p->name; } check = _XimCheckIMMode(res, XIM_GETIMVALUES); if(check == XIM_CHECK_INVALID) { continue; } else if (check == XIM_CHECK_ERROR) { - return p->value; + return p->name; } if(!_XimDecodeLocalIMAttr(res, top, p->value)) { - return p->value; + return p->name; } } return NULL; -- cgit v1.2.3