This is the mail archive of the
cygwin-developers@sources.redhat.com
mailing list for the Cygwin project.
Re: CTRL-U broken by OemToCharBuff?
- To: cygwin-developers at sourceware dot cygnus dot com
- Subject: Re: CTRL-U broken by OemToCharBuff?
- From: Kazuhiro Fujieda <fujieda at jaist dot ac dot jp>
- Date: 11 Jul 2000 06:26:25 +0900
- References: <20000709215323.A19246@cygnus.com>
>>> On Sun, 9 Jul 2000 21:53:23 -0400
>>> Chris Faylor <cgf@cygnus.com> said:
> The new OemToCharBuff call translates a CTRL-U to 0xa7 for some reason.
> Kazuhiro, can you explain this? It causes me problems when I try
> to use CTRL-U to wipe out a line of text.
I can't observe this problem on my platforms (NT4 Sp6a and Win98).
I guess this is a bug of OemToCharBuff on Win2k.
I propose the following simple patch. There is no difference
between OEM and ANSI code pages among code points less than
0x80, so the following patch is enough to fix this problem.
ChangeLog:
2000-07-11 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* fhandler_console.cc (fhandler_console::read): Apply OemToCharBuff
only to code points larger than 0x7f in order to avoid a bug on Win2K.
Index: fhandler_console.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_console.cc,v
retrieving revision 1.9
diff -u -p -r1.9 fhandler_console.cc
--- fhandler_console.cc 2000/07/04 02:26:20 1.9
+++ fhandler_console.cc 2000/07/10 20:50:26
@@ -190,7 +190,8 @@ fhandler_console::read (void *pv, size_t
}
else if (!(input_rec.Event.KeyEvent.dwControlKeyState & LEFT_ALT_PRESSED))
{
- OemToCharBuff (&ich, &ich, 1);
+ if ((unsigned char)ich > 0x7f)
+ OemToCharBuff (&ich, &ich, 1);
toadd = &ich;
}
else
____
| AIST Kazuhiro Fujieda <fujieda@jaist.ac.jp>
| HOKURIKU School of Information Science
o_/ 1990 Japan Advanced Institute of Science and Technology