This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

CYGWIN=codepage:oem read() patch


Hi cygwin developers,

thank you very very much for the cygwin=codepage:oem option.

The display is ok now, but when you getchar() resp. read() special characters
from the console, you get false results.

In winsup/cygwin/fhandler_console.cc, function fhandler_console::read,
every character > 127 is translated to ansi codepage.

My suggestion to fix this follows at the end of this mail.
It ist based on cygwin-1.1.7-1 without any snapshot.

Best regards.

- Lars A. Wuerfel

------------------------------------------------------------------------------
*** //C/TEMP/FHANDL~2.CC        Tue Jan  2 01:31:21 2001
--- fhandler_console.cc Tue Jan  2 01:31:30 2001
*************** fhandler_console::read (void *pv, size_t
*** 219,226 ****
--- 219,228 ----
              tmp[1] = ich;
              /* Need this check since US code page seems to have a bug when
                 converting a CTRL-U. */
+           if (current_codepage == ansi_cp) {  
              if ((unsigned char)ich > 0x7f)
                OemToCharBuff (tmp + 1, tmp + 1, 1);
+           }
              if (!(input_rec.Event.KeyEvent.dwControlKeyState & LEFT_ALT_PRESSED))
                toadd = tmp + 1;
              else
------------------------------------------------------------------------------


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]