[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#568167: epstopdf --nogs creates a file named -



retitle 568167 epstopdf --nogs doesn't write to standard output
found 568167 2009-10
tag 568167 + patch
thanks

Sorry, I had missed Hilmar's point. Indeed --nogs isn't supposed to cause
reading from standard input; one can and should use --filter --nogs for that.

Retitling the bug since the only real problem is the failure to write to
standard output.

I've just successfully tested the attached patch. A side effect is that if
one does want to write to ./- one needs to say --outfile=./- rather than
--outfile=- ; but that's hopefully not a problem.
--- /usr/bin/epstopdf	2010-09-07 11:54:45.000000000 +0200
+++ /usr/bin/epstopdf	2011-03-30 18:52:37.000000000 +0200
@@ -408,7 +408,11 @@
   $outname = $GS;
 }
 else {
-  open($OUT, '>', $OutputFilename) or error "Cannot write \"$OutputFilename\"";
+  if ($OutputFilename eq '-') {
+    open($OUT, '>-') or error "Cannot write to standard output";
+  } else {
+    open($OUT, '>', $OutputFilename) or error "Cannot write \"$OutputFilename\"";
+  }
   $outname = $OutputFilename;
 }
 binmode $OUT;

Reply to: