On Tuesday 26 March 2002 4:31 pm, Herbert Voss wrote:
> Angus Leeming wrote:
> > On Tuesday 26 March 2002 4:11 pm, Kayvan A. Sylvan wrote:
> >>On Tue, Mar 26, 2002 at 09:20:53AM +0100, Herbert Voss wrote:
> >>>Kayvan A. Sylvan wrote:
> >>>>Latest CVS, a document that was loading just fine as of a few days
> >>>>ago... Now I can no longer ``View Postscript''.
> >>
> >>I found the problem. A recent change makes LyX output the absolute path
> >>to the graphics file (instead of a relative path).
> >
> > It will only output the absolute path if the file is stored as an
> > absolute path. If you store it as relative to your doc, then it'll output
> > the relative path. That has to conform to the principle of least
> > surprise.
>
> these are the lines from latex():
>
> string const latex_str = before + '{' + prepareFile(buf) + '}' + after;
> os << latex_str;
>
> and prepareFile() makes it as an absolute path:
>
> string filename_  = MakeAbsPath(params().filename, buf->filePath());
> bool const zipped = zippedFile(filename_);
> [...]

So it does... 

Ahhh.  getExtFromContents() can't find the file otherwise. So what's the best 
solution here? Probably we should have:

        string filename_  = params().filename;
        bool const zipped = zippedFile(filename_);

        ...
        // Set the path so that the helper functions can find the graphics file.
        Path p(buffer->filePath());
        string const from = getExtFromContents(filename_);
        string const to   = findTargetFormat(from);

Does Path work on cygwin?

But we should still, definitely, make MakeAbsPath work for cygwin.

Angus

Reply via email to