From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11683 invoked by alias); 25 Jul 2005 00:41:36 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11676 invoked by uid 22791); 25 Jul 2005 00:41:34 -0000 Received: from dumbledore.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.11) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 25 Jul 2005 00:41:34 +0000 Received: (qmail 19382 invoked from network); 25 Jul 2005 00:41:31 -0000 Received: from unknown (HELO ?10.253.176.35?) (mitchell@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Jul 2005 00:41:31 -0000 Message-ID: <42E43537.3070407@codesourcery.com> Date: Mon, 25 Jul 2005 00:41:00 -0000 From: Mark Mitchell User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: Christopher Faylor CC: gdb-patches@sources.redhat.com Subject: Re: PATCH: MinGW readline -- revised References: <200507190011.j6J0B1Ma014410@sethra.codesourcery.com> <20050724211016.GA798@nevyn.them.org> <20050725003930.GA31264@trixie.casa.cgf.cx> In-Reply-To: <20050725003930.GA31264@trixie.casa.cgf.cx> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-07/txt/msg00182.txt.bz2 Christopher Faylor wrote: Thanks for the review. > *** readline/input.c 8 Dec 2002 22:31:37 -0000 1.5 > --- readline/input.c 18 Jul 2005 23:59:21 -0000 > *************** rl_getc (stream) > *** 422,431 **** > --- 422,438 ---- > int result; > unsigned char c; > > while (1) > { > + #ifdef __MINGW32__ > + /* On Windows, use a special routine to read a single character > + from the console. (Otherwise, no characters are available > + until the user hits the return key.) */ > + if (isatty (fileno (stream))) > + return getch (); > + #endif > result = read (fileno (stream), &c, sizeof (unsigned char)); > > if (result == sizeof (unsigned char)) > return (c); > > > This doesn't look right. Shouldn't there be an ifdef there? It's a > minor point but it looks like this would potentially produce dead code. If the stream is *not* a TTY, then we still want to use the ordinary code. There's just this one special case for TTYs. -- Mark Mitchell CodeSourcery, LLC mark@codesourcery.com (916) 791-8304