diff options
author | Igor Melichev <igor.melichev@artifex.com> | 2002-05-01 23:15:23 +0000 |
---|---|---|
committer | Igor Melichev <igor.melichev@artifex.com> | 2002-05-01 23:15:23 +0000 |
commit | 3ee1db5b0da719a439f00a418941313d07d50bef (patch) | |
tree | 4de6c4e73e5ce71442776f4f3f189e6637c9b18c /gs/src/seexec.c | |
parent | 4c600a4ee71ce46ea85782a7dfbd41a5e91ab152 (diff) |
Fix: More compatibility to Adobe interpreters in 'eexec'.
This is NON-BACKWARD-COMPATIBLE change. Now eexec skips all whitespaces at
the beginning of input stream, except for PFBDecode output.
Thanks to L. Peter Deutsch for participation.
Source Forge bug "[ 428891 ] Undefined commands interpreting Postscri".
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@2610 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/seexec.c')
-rw-r--r-- | gs/src/seexec.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gs/src/seexec.c b/gs/src/seexec.c index df96ec654..1bc88040e 100644 --- a/gs/src/seexec.c +++ b/gs/src/seexec.c @@ -105,20 +105,32 @@ s_exD_process(stream_state * st, stream_cursor_read * pr, if (ss->binary < 0) { /* * This is the very first time we're filling the buffer. - * Determine whether this is ASCII or hex encoding. */ const byte *const decoder = scan_char_decoder; int i; - if (rcount < 8 && !last) - return 0; + if (ss->pfb_state == 0) { + /* + * Skip witespace at the beginning of the input stream, + * because Adobe interpreters do this. + */ + for (; rcount; rcount--, p++) + if (decoder[p[1]] != ctype_space) + break; + pr->ptr = p; + count = min(wcount, rcount); + } /* + * Determine whether this is ASCII or hex encoding. * Adobe's documentation doesn't actually specify the test * that eexec should use, but we believe the following * gives correct answers even on certain non-conforming * PostScript files encountered in practice: */ + if (rcount < 8 && !last) + return 0; + ss->binary = 0; for (i = min(8, rcount); i > 0; i--) if (!(decoder[p[i]] <= 0xf || |