Summary: | GS_OPTIONS env doesn't allow quoted arguments or spaces. | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Stefan Kemper <stefan.kemper> |
Component: | Client API | Assignee: | Alex Cherepanov <alex> |
Status: | NOTIFIED FIXED | ||
Severity: | minor | CC: | sags5495 |
Priority: | P4 | ||
Version: | master | ||
Hardware: | All | ||
OS: | All | ||
Customer: | Word Size: | --- | |
Attachments: | SaGS_patch |
Description
Stefan Kemper
2006-10-31 10:04:22 UTC
Created attachment 2567 [details]
SaGS_patch
Thanks to SaGs for this patch. Needs testing with respect to affects on -c
parsing.
More comments from SaGS: My [short] explanation of the cause: In the situations above, some text gets "pushed back" into the arguments list. But: (a) Sometimes this text represents a single [already parsed] argument, retrieved by a previous call to arg_next(). In this case, quotes were already found and removed, spaces are part of the argument itself and not a delimiter. When this text is encountered again it should be taken as-is. (b) Other times (GS_OPTIONS) this text is an [unparsed] list of arguments; [only the] unquoted spaces are delimiters. When arg_next() reaches the string it has to parse it normally. (c) Currently arg_next() cannot know if it's case (a) or (b). It does the parsing from the <spaces are delimiters> point of view, but does not do the parsing from the <quotes are for quoting> point of view. IMHO, the <&& f != NULL> (hunk <@@ -172,9 +189,9 @@> in the attached diff) was an [incorrect and partial] attempt to handle (a). Taking <"> as a regular character in GS_OPTIONS is a direct consequence of this. I see absolutely no reason for accepting spaces as delimiters without allowing <"> to quote them. Sincerely yours, Gh. Savulescu The patch is committed as a rev. 8051. The failure to install display device is unrelated and unaffected by the patch. The content of GS_OPTIONS is executed first. If an error happens there, -dDisplayResolution= and -dDisplayFormat= are not interpreted but these options are required for the display device. Thanks to SaGS for the patch. |