Am 18.01.2011 um 15:23 schrieb Vincent van Ravesteijn:

>> Unfortunately it's not the only thing you did.
>> You introduced the regression that only the last occurrence of
>> a variable gets replaced. Your assumption was that boost returns
>> the first match - it's the last one instead!
>> 
>> $LyXDir/component1/bin:$LyXDir/component2/bin =>
>> $LyXDir/component1/bin:/path/to/lyx/component2/bin
>> 
> 
> Hmm Ok.
> 
>> But the goal was to avoid the replacement of a real $ in a file name.
>> This goal is missed if the user passes a file name with a real $ followed
>> by an existing variable name. Then the bug is there again.
> 
> Then, indeed you need to escape the variable whenever it is a real $
> in a filename, but you'd need to find all cases in which the user
> supplies a path and which for certain do not contain any environment
> variables.

I applied the patch as http://www.lyx.org/trac/changeset/37326.
To fix ticket 4177 the patch for GuiView.cpp is pending...
Is it ok to apply?

Stephan

The patch again:

Index: src/frontends/qt4/GuiView.cpp
===================================================================
--- src/frontends/qt4/GuiView.cpp       (Revision 37244)
+++ src/frontends/qt4/GuiView.cpp       (Arbeitskopie)
@@ -1950,13 +1950,14 @@
                        message(_("Canceled."));
                        return;
                }
-       } else
-               filename = fname;
+       } else {
+               // get absolute path of file and add ".lyx" to the filename if
+               // necessary.
+               filename = fileSearch(string(), fname, "lyx", 
support::may_not_exist).absFileName();
+       }
 
-       // get absolute path of file and add ".lyx" to the filename if
-       // necessary.
-       FileName const fullname =
-                       fileSearch(string(), filename, "lyx", 
support::may_not_exist);
+       FileName const fullname = FileName(filename);
+
        if (!fullname.empty())
                filename = fullname.absFileName();
 

Reply via email to