diff options
author | mckay <mckay@FreeBSD.org> | 2000-07-13 12:55:50 +0000 |
---|---|---|
committer | mckay <mckay@FreeBSD.org> | 2000-07-13 12:55:50 +0000 |
commit | 7b3c74238fbe6ac37ade9b9be86e6bccdc7ab6e5 (patch) | |
tree | 83d0db2937c4d11a8e7a1977500db33fcc14ca15 /usr.sbin/cdcontrol | |
parent | 797b7f6ddd1a3cf9f0003f851c886513d0e6e08e (diff) | |
download | FreeBSD-src-7b3c74238fbe6ac37ade9b9be86e6bccdc7ab6e5.zip FreeBSD-src-7b3c74238fbe6ac37ade9b9be86e6bccdc7ab6e5.tar.gz |
Fix the ^D -> core dump problem properly. ^D == "quit" again.
Diffstat (limited to 'usr.sbin/cdcontrol')
-rw-r--r-- | usr.sbin/cdcontrol/cdcontrol.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/cdcontrol/cdcontrol.c b/usr.sbin/cdcontrol/cdcontrol.c index 3a68af8..118d8c0 100644 --- a/usr.sbin/cdcontrol/cdcontrol.c +++ b/usr.sbin/cdcontrol/cdcontrol.c @@ -243,8 +243,6 @@ int run (int cmd, char *arg) { int l, r, rc; - if (arg == NULL) - return 0; switch (cmd) { case CMD_QUIT: @@ -956,8 +954,11 @@ input (int *cmd) el_set(el, EL_SIGNAL, 1); el_source(el, NULL); } - if ((bp = el_gets(el, &num)) == NULL || num == 0) + if ((bp = el_gets(el, &num)) == NULL || num == 0) { + *cmd = CMD_QUIT; + fprintf (stderr, "\r\n"); return (0); + } len = (num > MAXLINE) ? MAXLINE : num; memcpy(buf, bp, len); |