delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2000/07/10/17:48:18

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Mon, 10 Jul 2000 17:47:48 -0400
To: cygwin-developers AT sourceware DOT cygnus DOT com
Subject: Re: CTRL-U broken by OemToCharBuff?
Message-ID: <20000710174748.A18664@cygnus.com>
Reply-To: cygwin-developers AT sourceware DOT cygnus DOT com
Mail-Followup-To: cygwin-developers AT sourceware DOT cygnus DOT com
References: <20000709215323 DOT A19246 AT cygnus DOT com> <s1situdn0ce DOT fsf AT jaist DOT ac DOT jp>
Mime-Version: 1.0
User-Agent: Mutt/1.2i
In-Reply-To: <s1situdn0ce.fsf@jaist.ac.jp>; from fujieda@jaist.ac.jp on Tue, Jul 11, 2000 at 06:26:25AM +0900

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 AT cygnus DOT 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 AT jaist DOT ac DOT 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
>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019