Author: ken
Date: 2008-03-19 03:09:21 -0700 (Wed, 19 Mar 2008)
New Revision: 8602

Modified:
   trunk/gs/src/gdevvec.c
   trunk/gs/src/gsdevice.c
Log:
Fix (vector device): %pipe% IO device being opened as seekable.

Details:
Bug #689428 "?\226?\128?\152gs -sOutputFile=%pipe%cat?\226?\128?\153 doesn't work".

Based on the patch supplied by Dan Villiom Podlaski Christiansen. 

(gsdevice.c) in gx_device_open_output_file, if the parsed out iodevice
 is '%pipe%', then open the output 'file' non-seekable.

(gdevvec.c) Not strictly related, but gdev_vector_open_file_options could
 use 'fclose' on a stream opened with gx_device_open_output_file. Altered
 to use gx_device_close_output_file instead.

EXPECTED DIFFERENCES:
None.


Modified: trunk/gs/src/gdevvec.c
===================================================================
--- trunk/gs/src/gdevvec.c	2008-03-16 22:25:13 UTC (rev 8601)
+++ trunk/gs/src/gdevvec.c	2008-03-19 10:09:21 UTC (rev 8602)
@@ -300,7 +300,7 @@
 	    gs_free_object(vdev->v_memory, vdev->strmbuf,
 			   "vector_open(strmbuf)");
 	vdev->strmbuf = 0;
-	fclose(vdev->file);
+	gx_device_close_output_file(vdev, vdev->fname, vdev->file);
 	vdev->file = 0;
 	return_error(gs_error_VMerror);
     }

Modified: trunk/gs/src/gsdevice.c
===================================================================
--- trunk/gs/src/gsdevice.c	2008-03-16 22:25:13 UTC (rev 8601)
+++ trunk/gs/src/gsdevice.c	2008-03-19 10:09:21 UTC (rev 8602)
@@ -895,6 +895,8 @@
 	*pfile = dev->memory->gs_lib_ctx->fstdout;
 	/* Force stdout to binary. */
 	return gp_setmode_binary(*pfile, true);
+    } else if (parsed.iodev && !strcmp(parsed.iodev->dname, "%pipe%")) {
+	positionable = false;
     }
     if (fmt) {						/* filename includes "%nnd" */
 	long count1 = dev->PageCount + 1;

_______________________________________________
gs-cvs mailing list
gs-cvs@ghostscript.com
http://www.ghostscript.com/mailman/listinfo/gs-cvs
