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 b63f6e7905
commit f3b83fd4e4
1 changed files with 9 additions and 6 deletions

View File

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