On Tue, Sep 23, 2003 at 11:24:51PM +0000, Angus Leeming wrote:
> 
> Could you (or indeed anyone else with access to a compiler environment on a 
> Win32 box) write and test the equivalent function?
> 
> I'd imagine it would be something like
> 
>         size_t const size =
>                 GetShortPathName(input.c_str(), output, MAX_PATH);
>         std::string const result = size ? output : std::string();
>         delete [] output;
>         return result;
> }
> 
> -- 
> Angus

Under Cygwin, LyX already attempts to fix the path (for all exported
files, paths to pictures, etc). The fix is to output the Windows name
(e.g. "C:/Cygwin/Home/Kayvan/foo.lyx") for all file references.

This does not work when the underlying TeX installation is
the newest version of tetex for Cygwin.

In fact, I had to add the following hack to src/support/os_win32.c to get
around this issue:

$ cvs diff -u src/support/os_win32.C
Index: src/support/os_win32.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/support/os_win32.C,v
retrieving revision 1.12
diff -u -r1.12 os_win32.C
--- src/support/os_win32.C      2003/08/23 00:16:57     1.12
+++ src/support/os_win32.C      2003/09/23 22:48:24
@@ -107,8 +107,9 @@

 string external_path(string const & p)
 {
+       char const * const disable_cygwin_fixup = getenv("LYX_NO_CYGPATH_FIX");
        string dos_path = p;
-       if (is_absolute_path(p)) {
+       if ((! disable_cygwin_fixup) && is_absolute_path(p)) {
                char dp[255];
                cygwin_conv_to_full_win32_path(p.c_str(), dp);
                dos_path = subst(dp,'\\','/');

Then in my .bash_profile, I have "export LYX_NO_CYGPATH_FIX=1"

                        ---Kayvan
-- 
Kayvan A. Sylvan          | Proud husband of       | Father to my kids:
Sylvan Associates, Inc.   | Laura Isabella Sylvan  | Katherine Yelena (8/8/89)
http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92)

Reply via email to