From: mar Date: Mon, 26 Dec 1988 14:19:55 +0000 (+0000) Subject: exit cleanly on ^D X-Git-Tag: KREL1~43 X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/5bd0a4c421b26916bc7c71c29dc2e3384c5e2403 exit cleanly on ^D --- diff --git a/clients/passwd/chsh.c b/clients/passwd/chsh.c index 75bb9ed1..f0fee821 100644 --- a/clients/passwd/chsh.c +++ b/clients/passwd/chsh.c @@ -156,7 +156,8 @@ chsh(uname) while (!got_one) { printf("New shell: "); - (void) fgets(shell, sizeof(shell), stdin); + if (fgets(shell, sizeof(shell), stdin) == NULL) + leave(0); got_one = (strlen(shell) > 1); }