This is the mail archive of the cygwin-developers@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]

Re: CTRL-U broken by OemToCharBuff?


On Tue, Jul 11, 2000 at 06:26:25AM +0900, Kazuhiro Fujieda wrote:
>>>> 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 actually noticed this on both NT4 SP6a and W2K.  I didn't try it
on Windows 98 or 95.

Did my UNICODE patch look ok to you?  I inadvertently committed it
today.  I sort of like using UNICODE because I think it should work
around the problem of somebody setting their code page to something
besides the OEM code page using 'mode con: cp'.

The OemToAnsiBuff assumes that the code page is 437 which isn't
necessarily the case.  Isn't that correct?

cgf

>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
>

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