From 7b3c74238fbe6ac37ade9b9be86e6bccdc7ab6e5 Mon Sep 17 00:00:00 2001 From: mckay Date: Thu, 13 Jul 2000 12:55:50 +0000 Subject: Fix the ^D -> core dump problem properly. ^D == "quit" again. --- usr.sbin/cdcontrol/cdcontrol.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'usr.sbin/cdcontrol') 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); -- cgit v1.1