delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/05/20/19:22:33

From: earnie_boyd AT yahoo DOT com (Earnie Boyd)
Subject: Re: Entering Characters during sleep !
20 May 1998 19:22:33 -0700 :
Message-ID: <19980520114850.1082.rocketmail.cygnus.gnu-win32@send1e.yahoomail.com>
Reply-To: earnie_boyd AT yahoo DOT com
Mime-Version: 1.0
To: David Avrahamov <davidav AT msil DOT sps DOT mot DOT com>, gnu-win32 AT cygnus DOT com
Cc: mandy AT msil DOT sps DOT mot DOT com


Well it's definitely within the cygwinb19.dll.  I tried your test with
Mingw32 and it works fine.  Also, I tried it with b18 and it didn't
work.

It appears that the input buffer is being cleared before the data is
retrieved.

---David Avrahamov <davidav AT msil DOT sps DOT mot DOT com> wrote:
>
> Hi everyone,
> 
> I have encountered a problem while running a program which do sleep 
> before prompting for input.
> All the input characters that are entered during this time are not
> entered into the input buffer so it is as I didn't enter them at all.
> 
> I have this small code which illustrates this problem.
> This problem doesn't happen neither on UNIX nor on MSVC.
> P.S. Instead of doing sleep I entered a big loop and it acted the
same.
> 
> Any ideas ?
> Thanks,
> 
> 
> 
> #include <stdio.h>
> main()
> {
>     char st1[100];
>     unsigned long i;
> 
>     printf("Type something !\n");
>     for (i=0;i<50000000;i++);
> 
>     scanf("%s",st1);
> 
>     printf("You typed: %s\n",st1);
> }
> 
> 
> 
> -- 
> David Avrahamov      
> Phone number: 952-2176
> Software department
> Motorola Semiconductor Israel
> -
> For help on using this list (especially unsubscribing), send a
message to
> "gnu-win32-request AT cygnus DOT com" with one line of text: "help".
> 

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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