summaryrefslogtreecommitdiffstats
path: root/lib/libstand/gets.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1998-10-31 02:48:29 +0000
committermsmith <msmith@FreeBSD.org>1998-10-31 02:48:29 +0000
commite6108119c4a18c3dd11e5fda0bbd6b84a63a923f (patch)
tree77ffcdb32b212aed315a6b8b4ea9e120a4452dff /lib/libstand/gets.c
parent02030ba04b7d957e3218848bb30779ab2dbd82b1 (diff)
downloadFreeBSD-src-e6108119c4a18c3dd11e5fda0bbd6b84a63a923f.zip
FreeBSD-src-e6108119c4a18c3dd11e5fda0bbd6b84a63a923f.tar.gz
Add a new field to the devsw structure; dv_print, to print all valid units
etc. associated with the device entry. Consider EOF an 'error' for fgetstr if we haven't read anything yet. You *MUST* recompile and reinstall libstand before rebuilding the bootstrap.
Diffstat (limited to 'lib/libstand/gets.c')
-rw-r--r--lib/libstand/gets.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libstand/gets.c b/lib/libstand/gets.c
index 3fbe9b4..dc26a99 100644
--- a/lib/libstand/gets.c
+++ b/lib/libstand/gets.c
@@ -95,8 +95,11 @@ fgetstr(char *buf, int size, int fd)
err = read(fd, &c, sizeof(c));
if (err < 0) /* read error */
return(-1);
- if (err == 0) /* EOF */
+ if (err == 0) { /* EOF */
+ if (len == 0)
+ return(-1); /* nothing to read */
break;
+ }
if ((c == '\r') || /* line terminators */
(c == '\n'))
break;
OpenPOWER on IntegriCloud