--- gutenprint-5.2.4/src/main/print-ps.c.old 2009-12-29 16:34:56.000000000 +0000 +++ gutenprint-5.2.4/src/main/print-ps.c 2009-12-29 16:35:02.000000000 +0000 @@ -1089,7 +1089,6 @@ int col; /* Current column */ static const char *hex = "0123456789ABCDEF"; - col = 0; while (length > 0) { @@ -1133,6 +1132,9 @@ unsigned char c[5]; /* ASCII85 encoded chars */ static int column = 0; /* Current column */ +#define OUTBUF_SIZE 4096 + unsigned char outbuffer[OUTBUF_SIZE+10]; + int outp=0; while (length > 3) { @@ -1144,35 +1146,44 @@ if (b == 0) { - stp_putc('z', v); + outbuffer[outp++]='z'; column ++; } else { - c[4] = (b % 85) + '!'; + outbuffer[outp+4] = (b % 85) + '!'; b /= 85; - c[3] = (b % 85) + '!'; + outbuffer[outp+3] = (b % 85) + '!'; b /= 85; - c[2] = (b % 85) + '!'; + outbuffer[outp+2] = (b % 85) + '!'; b /= 85; - c[1] = (b % 85) + '!'; + outbuffer[outp+1] = (b % 85) + '!'; b /= 85; - c[0] = b + '!'; + outbuffer[outp] = b + '!'; - stp_zfwrite((const char *)c, 5, 1, v); + outp+=5; column += 5; } if (column > 72) { - stp_putc('\n', v); + outbuffer[outp++]='\n'; column = 0; } + if(outp>=OUTBUF_SIZE) + { + stp_zfwrite((const char *)outbuffer, outp, 1, v); + outp=0; + } + data += 4; length -= 4; } + if(outp) + stp_zfwrite((const char *)outbuffer, outp, 1, v); + if (last_line) { if (length > 0)