mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-28 10:00:51 +00:00
* remote-udi.c (udi_wait, case UDIStdinNeeded): Use a loop calling
getchar() (terminated only on '\n') instead of scanf. Send the '\n' which terminates it to the remote system.
This commit is contained in:
@@ -473,11 +473,22 @@ udi_wait (status)
|
||||
fwrite (sbuf, 1, CountDone, stderr);
|
||||
fflush(stderr);
|
||||
continue;
|
||||
|
||||
case UDIStdinNeeded:
|
||||
scanf ("%s", sbuf);
|
||||
i = strlen (sbuf);
|
||||
UDIPutStdin (sbuf, (UDISizeT)i, &CountDone);
|
||||
continue;
|
||||
{
|
||||
int ch;
|
||||
i = 0;
|
||||
do
|
||||
{
|
||||
ch = getchar ();
|
||||
if (ch == EOF)
|
||||
break;
|
||||
sbuf[i++] = ch;
|
||||
} while (i < SBUF_MAX && ch != '\n');
|
||||
UDIPutStdin (sbuf, (UDISizeT)i, &CountDone);
|
||||
continue;
|
||||
}
|
||||
|
||||
case UDIRunning:
|
||||
/* In spite of the fact that we told UDIWait to wait forever, it will
|
||||
return spuriously sometimes. */
|
||||
|
||||
Reference in New Issue
Block a user