Improve Cygwin support
authorMikael Berthe <mikael@lilotux.net>
Sun, 09 Dec 2007 19:26:37 +0100
changeset 1394 bba74a50dedf
parent 1393 216b4da93e08
child 1395 d431cd75eb53
Improve Cygwin support On Cygwin, isprint() isn't enough so we consider that key codes between 161 and 255 are printable.
mcabber/src/screen.c
--- a/mcabber/src/screen.c	Sun Dec 09 19:17:42 2007 +0100
+++ b/mcabber/src/screen.c	Sun Dec 09 19:26:37 2007 +0100
@@ -3773,7 +3773,19 @@
 
 display:
   if (display_char) {
-    if (kcode.utf8 ? iswprint(key) : (isprint(key) && !is_speckey(key))) {
+    guint printable;
+
+    if (kcode.utf8) {
+      printable = iswprint(key);
+    } else {
+#ifdef __CYGWIN__
+      printable = (isprint(key) || (key >= 161 && key <= 255))
+                  && !is_speckey(key);
+#else
+      printable = isprint(key) && !is_speckey(key);
+#endif
+    }
+    if (printable) {
       char tmpLine[INPUTLINE_LENGTH+1];
 
       // Check the line isn't too long