From 6ae6223250c2deef708c4bb457a9e015b8d22075 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 17 May 2012 19:09:52 +0200 Subject: [PATCH] misccoms.c, com_quit(), implement exitcode --- src/frontend/misccoms.c | 5 +++++ 1 file changed, 5 insertions(+) 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)