about summary refs log tree commit diff
path: root/converter/other/pnmtops.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-05-27 19:48:15 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-05-27 19:48:15 +0000
commitf3f8fc6f37c4ad9df8a286697fc4620a236f6c19 (patch)
tree9e87516773fa38d61f5ef604e498febdbf4dc561 /converter/other/pnmtops.c
parent8b2a69de775d8a2a0f572556758057d7c2cf1fc8 (diff)
downloadnetpbm-mirror-f3f8fc6f37c4ad9df8a286697fc4620a236f6c19.tar.gz
netpbm-mirror-f3f8fc6f37c4ad9df8a286697fc4620a236f6c19.tar.xz
netpbm-mirror-f3f8fc6f37c4ad9df8a286697fc4620a236f6c19.zip
Release 10.62.07
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@1914 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/pnmtops.c')
-rw-r--r--converter/other/pnmtops.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c
index 4b56b6a2..dc55a7e3 100644
--- a/converter/other/pnmtops.c
+++ b/converter/other/pnmtops.c
@@ -1905,6 +1905,7 @@ convertPage(FILE *       const ifP,
         /* The file stream which is the head of the filter chain; we write to
            this and filtered stuff comes out the other end.
         */
+    FILE * filterChainOfP;
 
     pnm_readpaminit(ifP, &inpam, PAM_STRUCT_SIZE(tuple_type));
 
@@ -1947,7 +1948,11 @@ convertPage(FILE *       const ifP,
     initOutputEncoder(&oe, inpam.width, bitsPerSample,
                       rle, flate, ascii85, psFilter);
 
-    spawnFilters(stdout, &oe, &feedFileP, filterPidList);
+    fflush(stdout);
+    filterChainOfP = fdopen(dup(fileno(stdout)), "w");
+        /* spawnFilters() closes this.  See FILE MANAGEMENT above */
+
+    spawnFilters(filterChainOfP, &oe, &feedFileP, filterPidList);
  
     convertRaster(&inpam, bitsPerSample, psFilter, feedFileP);