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

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
To: cygwin-developers AT sourceware DOT cygnus DOT com
Subject: Re: CTRL-U broken by OemToCharBuff?
References: <20000709215323 DOT A19246 AT cygnus DOT com>
Mime-Version: 1.0 (generated by tm-edit 7.106)
From: Kazuhiro Fujieda <fujieda AT jaist DOT ac DOT jp>
Date: 11 Jul 2000 06:26:25 +0900
In-Reply-To: Chris Faylor's message of Sun, 9 Jul 2000 21:53:23 -0400
Message-ID: <s1situdn0ce.fsf@jaist.ac.jp>
Lines: 42
X-Mailer: Gnus v5.3/Emacs 19.34

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

____
  | AIST      Kazuhiro Fujieda <fujieda AT jaist DOT ac DOT jp>
  | HOKURIKU  School of Information Science
o_/ 1990      Japan Advanced Institute of Science and Technology

- Raw text -


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