fixing mpiv on installation path with spaces
Hello, last year Taco added many patches to make sure that ConTeXt works even when installed to "C:\Documents and Settings\ ..." and other weird paths with spaces. However metapost in mkiv still fails. I figured out that the following patch (which *won't* handle paths with quotation marks properly) in mlib-run.lua fixes the problem: local preamble = [[ boolean mplib ; mplib := true ; let dump = endinput ; - input %s ; + input "%s" ; ]] but I'm not sure if there are any other side effects or if there are other places that also need a patch. I didn't test with filenames with spaces or with filenames with weird characters that need escaping. Maybe it would be helpful to pass file.addsuffix(name,"mp") through additional filter (instead of simply adding quotation marks) that would also check if any other character needs escaping and add quotation marks if needed. Minimal example: - install ConTeXt into path with spaces - test with context on \starttext \startMPcode draw fullcircle scaled 3cm; \stopMPcode \stoptext I would be grateful if somebody could take a look, so that a fix could make it into TL 2012. Thanks, Mojca
On 16-5-2012 01:45, Mojca Miklavec wrote:
Hello,
last year Taco added many patches to make sure that ConTeXt works even when installed to "C:\Documents and Settings\ ..." and other weird paths with spaces. However metapost in mkiv still fails. I figured out that the following patch (which *won't* handle paths with quotation marks properly) in mlib-run.lua fixes the problem:
local preamble = [[ boolean mplib ; mplib := true ; let dump = endinput ; - input %s ; + input "%s" ; ]]
I'm always a it puzzled by mp's file name handling as the name is not really a string. MP oracle Taco has to speak up ... Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 16-5-2012 01:45, Mojca Miklavec wrote:
Maybe it would be helpful to pass file.addsuffix(name,"mp") through additional filter (instead of simply adding quotation marks) that would also check if any other character needs escaping and add quotation marks if needed.
let's for the moment just add the quotes .. using " in a tex tds path is not that clever anyway and this piece of mp code only deals with loading the format which always is located in a sane path Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Mojca Miklavec