On Mon, Apr 03, 2006 at 11:22:48AM +0200, Georg Baum wrote: > Enrico Forestieri wrote: > > > No, it is not because of that. The point is that > > lyx::support::latex_path() calls ChangeExtensions, which in turn > > calls internal_path(), which would turn the path into posix in > > cygwin. > > I see. Calling internal_path() in ChangeExtension seems wrong to me. I'll > have a look if that can be changed. ChangeExtension (and all other file > name manipulating) should IMO not need to change the path format. > > > Please, attached find the patch satifying your requests. All > > internal paths are in posix style. External and latex paths may > > be posix or windows style depending on cygwin_path_fix, exactly > > as it was. > > > > I have not introduced any new boolean and substantially left > > things as they were. Only, all bugs are now corrected and there > > is no mess of internal paths. > > Excellent. I'll have a look at it tonight.
Only a small glitch, Georg. In os_cygwin.C, the test "p.length() < 1" in is_posix_path() and is_windows_path() should be changed to "p.length() <= 1" +// In both is_posix_path() and is_windows_path() it is assumed that +// a valid posix or windows path is passed. They simply tell whether +// the path looks posix/windows or not. + +bool is_posix_path(string const & p) +{ + return p.empty() || + (!contains(p, '\\') && (p.length() < 1 || p[1] != ':')); ^^^^^^^^^^^^^^ +} + +// This is a test for a win32 style path with forward slashes. + +bool is_windows_path(string const & p) +{ + return p.empty() || + (!contains(p, '\\') && (p.length() < 1 || p[1] == ':')); ^^^^^^^^^^^^^^ +} -- Enrico