Tidy up sp_shutdown with Cider.

This commit is contained in:
Brian Taylor 2023-07-03 16:19:13 -07:00 committed by Holger Vogt
parent 51b361bbf0
commit 159e185bfe
1 changed files with 9 additions and 6 deletions

View File

@ -536,13 +536,16 @@ sp_shutdown(int exitval)
#ifdef CIDER #ifdef CIDER
{ {
extern int IsCiderLoaded(void); extern int IsCiderLoaded(void);
char *cider_quit = getenv("CIDER_COM_QUIT"); char *cider_quit_s = NULL;
bool cider_com_quit = TRUE; bool cider_com_quit = TRUE;
if (cider_quit && eq(cider_quit, "OFF")) { if (exitval != EXIT_BAD) {
cider_com_quit = FALSE; cider_quit_s = getenv("CIDER_COM_QUIT");
} if (cider_quit_s && *cider_quit_s && eq(cider_quit_s, "OFF")) {
if (cider_com_quit && IsCiderLoaded() > 0) { cider_com_quit = FALSE;
com_quit(NULL); }
if (cider_com_quit && IsCiderLoaded() > 0) {
com_quit(NULL);
}
} }
} }
#endif #endif