I'd like to include this patch, which ignores key CTRL-D.
Currently CTRL-D may cause garbage output or infinite loop.

diff --git a/src/lib/sockio-c.c b/src/lib/sockio-c.c
index 57163eb9..17cc1056 100644
--- a/src/lib/sockio-c.c
+++ b/src/lib/sockio-c.c
@@ -805,15 +805,16 @@ remote_stdio(Sock *sock)
       return;
     }
     if (FD_ISSET(0, &rd)) {
-      fgets(buf,1024,stdin);
-      len = strlen(buf);
-      /*
-          gets(buf);
-          len = strlen(buf);
-          *(buf+len) = '\n';
-          *(buf+len+1) = '\0';
-      */
-      swrite(sock, buf, len, "writing to remote stdin");
+      len = read(0, buf, 1024);
+      if (len == -1) {
+        perror("read from stdin");
+        return;
+      }
+      if (len == 0) {
+        /* EOF (CTRL-D) received, ignore it for now */
+      } else {
+        swrite(sock, buf, len, "writing to remote stdin");
+      }
     }
     if (FD_ISSET(sock->socket, &rd)) {
       len = sread(sock, buf, 1024, "stdio");

On 1/19/19 1:13 AM, Waldek Hebisch wrote:
> After the last few commits we are essentially ready for release.
> I will allow a few days for possible extra fixes.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/7445911b-2f71-b527-2bff-5b34bc987dc4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to