diff --git a/src/frontend/misccoms.c b/src/frontend/misccoms.c index 73eb3a45b..2028b1b01 100644 --- a/src/frontend/misccoms.c +++ b/src/frontend/misccoms.c @@ -41,9 +41,14 @@ com_quit(wordlist *wl) (wl && wl->wl_word && cieq(wl->wl_word, "noask")) || cp_getvar("noaskquit", CP_BOOL, NULL); + int exitcode = 0; + gr_clean(); cp_ccon(FALSE); + if(wl && wl->wl_word && 1 == sscanf(wl->wl_word, "%d", &exitcode)) + exit(exitcode); + /* Make sure the guy really wants to quit. */ if (!ft_nutmeg && !noask) { for (cc = ft_circuits; cc; cc = cc->ci_next)