Must check for error on stdin in addition to checking for EOF.
authorThomas Ferrin <tef@ucbvax.Berkeley.EDU>
Thu, 21 Jan 1988 08:25:59 +0000 (00:25 -0800)
committerThomas Ferrin <tef@ucbvax.Berkeley.EDU>
Thu, 21 Jan 1988 08:25:59 +0000 (00:25 -0800)
SCCS-vsn: usr.bin/ftp/main.c 5.9

usr/src/usr.bin/ftp/main.c

index 3128800..0e0808e 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.9 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -208,7 +208,7 @@ cmdscanner(top)
                        (void) fflush(stdout);
                }
                if (gets(line) == 0) {
                        (void) fflush(stdout);
                }
                if (gets(line) == 0) {
-                       if (feof(stdin))
+                       if (feof(stdin) || ferror(stdin))
                                quit();
                        break;
                }
                                quit();
                        break;
                }