[gs-cvs] rev 7751 - trunk/gs/src

alexcher at ghostscript.com alexcher at ghostscript.com
Wed Feb 28 18:26:03 PST 2007


Author: alexcher
Date: 2007-02-28 18:26:03 -0800 (Wed, 28 Feb 2007)
New Revision: 7751

Modified:
   trunk/gs/src/stream.c
Log:
When a chain of decoding filters encounters EOF, close the last filter in
the chain. This seems to contradict PLRM3 but matches the observed behavior
of Adobe interpreters. Bug 688745, customer 384.

DETAILS:
Contrary to PLRM3, Adobe interpreters close disk files and filters equaly.
Old Ghostscript code was inconsistant and closed the first and the last
filters in the chain, or the last 2 filters depending whether the first file
is a disk file or a filter.

DIFFERENCES:
No Comparefiles or CET differences.


Modified: trunk/gs/src/stream.c
===================================================================
--- trunk/gs/src/stream.c	2007-02-28 18:49:49 UTC (rev 7750)
+++ trunk/gs/src/stream.c	2007-03-01 02:26:03 UTC (rev 7751)
@@ -818,11 +818,14 @@
 	    MOVE_AHEAD(curr, prev);
 	    stream_compact(curr, false);
 	}
-	/* If curr reached EOD and is a filter or file stream, close it. */
-	/* (see PLRM 3rd, sec 3.8.2, p80) */
+	/* If curr reached EOD and is a filter or file stream, close it
+         * if it is the last filter in the pipeline. Closing the last filter
+         * seems to contradict PLRM3 but matches Adobe interpreters.
+         */
 	if ((strm != 0 || curr->file) && status == EOFC &&
 	    curr->cursor.r.ptr >= curr->cursor.r.limit &&
-	    curr->close_at_eod
+	    curr->close_at_eod &&
+            prev == 0
 	    ) {
 	    int cstat = sclose(curr);
 



More information about the gs-cvs mailing list