Enrico Forestieri wrote: > The problem is that I have not a full grasp of the overall code and don't > want introduce changes without fully knowing the consequences. I repeat, > my idea is of only fixing what is broken, making changes that I fully > understand. As a problem arised with [EMAIL PROTECTED], I tried to fix only > that case.
I do fully agree. My point however is that using a trailing '/' as flag will sooner or later strike back. If it is really necessary to tell latex_path() whether it should call external_path() or not, add an additional parameter that tells exactly that. > --- src/support/filetools.C (revision 13450) > +++ src/support/filetools.C (working copy) > @@ -86,7 +86,15 @@ string const latex_path(string const & o > latex_path_extension extension, > latex_path_dots dots) > { > - string path = subst(original_path, "\\", "/"); > + string path; > + > + if (suffixIs(original_path, '/')) { > + path = rtrim(path, "/"); > + // The call to os::external_path is needed for Cygwin. > + path = subst(os::external_path(original_path), "\\", "/"); > + } else > + path = subst(original_path, "\\", "/"); > + > path = subst(path, "~", "\\string~"); > if (path.find(' ') != string::npos) { > // We can't use '"' because " is sometimes active (e.g. if > > > along the lines of the second patch. Both approaches work and are robust > because the trailing '/' is anyway added. Please, tell me what to do. This version is preferrable since it does not need the cygwin switch. > I do not feel confortable in unconditionally call external_path (I don't > want to fix what is not broken). I think that you can safely call it unconditionally. I looked it up, and latex_path() is only called on filenames that are written to .tex files. I would be very surprised if a TeX compiler exists on windows that needs win style paths in [EMAIL PROTECTED] but posix style paths in \includegraphics or \input. To be sure you could make a simple test: Call external_path() unconditionally, and try to view a document that contains a graphics inset, and two include insets, one with \input and one with \include. All files should be entered with absolute names. If my theory is right then running latex on the exported .tex file will work with the unconditional fix and fail with the conditional one. The absolute names are necessary to get slashes in the name, and running latex on the exported .tex file is necessary because LyX uses always relative paths for running latex internally. Georg PS: You might want to have a look at the cygwin version of external_path(). It contains unreachable code.