diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2018-09-10 08:41:34 +0100 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2018-09-10 08:47:17 +0100 |
commit | 7b0c4cc3e79d1e689b5fc3251a1130f409ed7a82 (patch) | |
tree | 6ddfe84ebd09dce9cd6a39855f148194709b3be8 | |
parent | 95281026d983bff8f72e431c7f620a0e8d07c2af (diff) | |
download | ghostpdl-7b0c4cc3e79d1e689b5fc3251a1130f409ed7a82.tar.gz |
Bug 699748 "gs9.24/windows can't process environment variable GS_OPTIONS anymore"
This problem only exhibits in a 64-bit build.
The problem is caused by the union of 's' and 'file' in the arg_source
structure. When in a 32-bit build, this happens to work out to be 0
when the source is a string and not a file. But in a 64-bit it does not.
Now because we have a 'is_file' member in the structure this isn't a
problem, except that in get_codepoint() we pass both the u.file and
u.str members to the decoding function. In get_codepoint_utf8 we then
check to see if 'file' is 0, and if it is not, we attempt to read from
it. If 'file' is 0, then we treat this as a string instead.
To avoid altering the decoding function, with potential knock-on effects
through the code, I've chosen to test the 'is_file' member and pass
NULL for the file if this is not a file.
-rw-r--r-- | base/gsargs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/base/gsargs.c b/base/gsargs.c index fce4d5936..d7f3be7df 100644 --- a/base/gsargs.c +++ b/base/gsargs.c @@ -182,7 +182,7 @@ static int get_codepoint(arg_list *pal, arg_source *pas) int (*fn)(FILE *file, const char **str); fn = (!pas->is_file && pas->u.s.decoded ? get_codepoint_utf8 : pal->get_codepoint); - return fn(pas->u.file, &pas->u.s.str); + return fn(pas->is_file ? pas->u.file : NULL, &pas->u.s.str); } /* Get the next arg from a list. */ |