misccoms.c, com_quit(), implement exitcode

This commit is contained in:
rlar 2012-05-17 19:09:52 +02:00
parent 5436de5bab
commit 6ae6223250
1 changed files with 5 additions and 0 deletions

View File

@ -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)