Bug 658 - XStringToKeysym fails for Greek_IOTAdiaeresis
Summary: XStringToKeysym fails for Greek_IOTAdiaeresis
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xlib (show other bugs)
Version: 6.7.0
Hardware: All All
: high normal
Assignee: Alan Coopersmith
QA Contact:
URL: http://bugs.opensolaris.org/bugdataba...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-22 13:25 UTC by Alan Coopersmith
Modified: 2005-08-19 19:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
testcase (444 bytes, text/plain)
2004-05-22 13:40 UTC, Alan Coopersmith
no flags Details
Patch to xc/lib/X11/util/makekeys.c (1.76 KB, patch)
2004-05-22 13:43 UTC, Alan Coopersmith
no flags Details | Splinter Review

Description Alan Coopersmith 2004-05-22 13:25:34 UTC
XStringToKeysym("Greek_IOTAdiaeresis") returns NoSymbol in X11R6.7.0, instead of
the correct value of 0x7a5 as returned in prior versions.   This causes VSW5
test case XStringToKeysym-7 to fail.

The problem is caused by changing the definition in xc/include/keysymdef.h from
#define XK_Greek_IOTAdiaeresis                         0x7a5
to:
#define XK_Greek_IOTAdieresis                          0x7a5
#define XK_Greek_IOTAdiaeresis         XK_Greek_IOTAdieresis /* old typo */

Unforunately, the code that builds the database used by XStringToKeysym()
(xc/lib/X11/util/makekeys.c) can't handle symbols defined as aliases to other
symbols instead of given a value directly.  This affects these 4 symbol 
definitions in the X11R6.7.0 version of keysymdef.h:
#define XK_Oslash              XK_Ooblique
#define XK_ooblique            XK_oslash
#define XK_Arabic_farsi_yeh                     XK_Farsi_yeh
#define XK_Greek_IOTAdiaeresis         XK_Greek_IOTAdieresis /* old typo */

Fixing that code to correctly parse these entries makes XStringToKeysym()
return the correct values for these keysyms.

[This was discovered by Sun QA and is tracked in Sun's bug database as 
 bug id 5037725.]
Comment 1 Alan Coopersmith 2004-05-22 13:40:40 UTC
Created attachment 311 [details]
testcase

Compile with:
  $(CC) -o testcase test.c -lX11

To test the 4 currently affected symbols, run:
  ./testcase Greek_IOTAdiaeresis Arabic_farsi_yeh ooblique Oslash
and make sure the values printed are not 0.

To test all symbols defined in keysymdef.h, run:
  perl -n -e 'print $1,"\n" if /^#define XK_(\w+)\s+/' \
    /usr/include/X11/keysymdef.h | ./testcase | grep '0x00000000:'
If any symbols are listed with values of 0x00000000 then there is a bug.
Comment 2 Alan Coopersmith 2004-05-22 13:43:04 UTC
Created attachment 312 [details] [review]
Patch to xc/lib/X11/util/makekeys.c
Comment 3 Alan Coopersmith 2004-05-22 13:49:43 UTC
Fix committed to CVS head:

Log message:
  2004-05-21  Alan Coopersmith  <alan.coopersmith@sun.com>
  
  	* xc/lib/X11/util/makekeys.c:
  	Bugzilla #658: XStringToKeysym fails for Greek_IOTAdiaeresis
  	(Fixes VSW5 testcase XStringToKeysym-7 failure)

Modified files:
      ./:
        ChangeLog 
      xc/lib/X11/util/:
        makekeys.c 
  
  Revision      Changes    Path
  1.34          +7 -1      xc/ChangeLog
  1.3           +27 -10    xc/lib/X11/util/makekeys.c


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.