aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-09-09 17:58:46 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-09-09 17:58:46 +0000
commit5c303f64ca252af6e7481942e26c643dad4c6620 (patch)
tree2a740c34938c7796b09024fc285113cc305a3407 /gdb
parentfc7ed03957ea4782b8aba6741a2afa4ad2579c4f (diff)
downloadgdb-5c303f64ca252af6e7481942e26c643dad4c6620.zip
gdb-5c303f64ca252af6e7481942e26c643dad4c6620.tar.gz
gdb-5c303f64ca252af6e7481942e26c643dad4c6620.tar.bz2
* 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/remote-udi.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/gdb/remote-udi.c b/gdb/remote-udi.c
index 20e8d26..3fa2da9 100644
--- a/gdb/remote-udi.c
+++ b/gdb/remote-udi.c
@@ -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. */