File shift-ctrl-endian-problem.patch of Package ami

diff -ru ami-1.2.2.orig/Ximd/i18nMethod.c ami-1.2.2/Ximd/i18nMethod.c
--- ami-1.2.2.orig/Ximd/i18nMethod.c	2001-05-31 10:50:37.000000000 +0200
+++ ami-1.2.2/Ximd/i18nMethod.c	2004-01-29 17:39:33.000000000 +0100
@@ -634,6 +634,8 @@
     }
 }
 
+#define Swap16(n) (((n) << 8 & 0xff00) | ((n) >> 8 & 0xff))
+
 static Status
 xi18n_forwardEvent(XIMS ims, IMForwardEventStruct *call_data)
 {
@@ -673,6 +675,9 @@
     FrameMgrPutToken(fm, call_data->sync_bit);
 
     replyp += total_size;
+    if (_Xi18nNeedSwap(i18n_core, call_data->connect_id) != 0) {
+        call_data->event.xkey.state = Swap16(call_data->event.xkey.state);
+    }   
     EventToWireEvent(&(call_data->event), (xEvent *)replyp, &serial);
 
     FrameMgrPutToken(fm, serial);
openSUSE Build Service is sponsored by