Am 17.01.2011 um 16:07 schrieb Stephan Witt: > Am 16.01.2011 um 16:12 schrieb Pavel Sanda: > >> Stephan Witt wrote: >>> Am 16.01.2011 um 14:25 schrieb Peter Kümmel: >>> >>>> The patch complete removes the regex logic in replaceEnvironmentPath >>>> because >>>> it seems to be buggy, could someone have a look at it, I think it would be >>>> better to fix the regex code. >>> >>> The boost regex (as I understand the docs) returns the last match in string. >>> >>> So we have two problems AFAICS: >>> 1) the last environment var gets replaced only >>> 2) a missing environment var is passed verbatim >>> E.g. "$UNDEFINED" => "$UNDEFINED", a shell would make "$UNDEFINED" => "" >>> The second problem makes it hard to correct the first. >>> >>> The attached patch changes (corrects) 2) and fixes 1). >>> The code is much simpler now. If we want to retain 2) >>> I have to make another more complex patch... >> >> so it depends whether the guys are satisfied with this. > > Vincent, > > svn blame points to you... > What's your opinion regarding the change in behavior with > undefined variables? Why do you pass the undefined variable > verbatim?
Sorry, after some investigation I could answer this myself. But I have to say I'm not confident of the solution for ticket http://www.lyx.org/trac/ticket/4177, it is pure luck to work for random path names containing a dollar sign. If the dollar prefixes a existent variable it get's replaced again. Here some escape mechanism should enter the scene. Stephan