summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaph Levien <raph.levien@artifex.com>2001-04-07 00:08:08 +0000
committerRaph Levien <raph.levien@artifex.com>2001-04-07 00:08:08 +0000
commitc91aaf91a243c592418c848f25e4408c5c349eeb (patch)
treeaee90f4b009f5dfc2e35722d8ccd95b5060b9e63
parent0435f11fadb421f709e6220b8dfb36d473287b4f (diff)
downloadghostpdl-c91aaf91a243c592418c848f25e4408c5c349eeb.tar.gz
Uses better test for avoiding crash on "gs -h". Also updates API document.
Thanks to Russell Lang. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@1389 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--gs/doc/API.htm4
-rw-r--r--gs/src/imain.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/gs/doc/API.htm b/gs/doc/API.htm
index 06331e3e2..a16a4d2bd 100644
--- a/gs/doc/API.htm
+++ b/gs/doc/API.htm
@@ -348,8 +348,8 @@ The <b><tt>gsapi_init_with_args</tt></b>, <b><tt>gsapi_run_*</tt></b> and
<td>&nbsp;
<td>"<b><tt>gs -h</tt></b>" has been executed.
This is not an error.
- The interpreter was not initialised and
- <b><tt>gsapi_exit()</tt></b> must NOT be called.
+ The interpreter was not initialised. It is safe to call
+ <b><tt>gsapi_exit()</tt></b>.
<tr valign=top> <td align=left>&lt; 0
<td>&nbsp;
<td>Error
diff --git a/gs/src/imain.c b/gs/src/imain.c
index 7e838beee..1cd4efbb0 100644
--- a/gs/src/imain.c
+++ b/gs/src/imain.c
@@ -765,7 +765,7 @@ gs_main_finit(gs_main_instance * minst, int exit_status, int code)
* alloc_restore_all will close dynamically allocated devices.
*/
/* Flush stdout and stderr */
- if (i_ctx_p != NULL)
+ if (minst->init_done >= 2)
gs_main_run_string(minst,
"(%stdout) (w) file closefile (%stderr) (w) file closefile quit",
0 , &exit_code, &error_object);