The attached patch fixes the bug reported here:
http://thread.gmane.org/gmane.editors.lyx.general/29227

In my intention this is the first of a series of patches aimed at polishing
the Cygwin target, which I think is lagging behind. Please, tell me if this
ok with you. I have no problem in maintaining the Cygwin target but my time
is limited so I cannot guarantee a continuous commitment. I will do it time
permitting. There should be no big problems, as I think the Cygwin users
will not be more than those I can count with only one of my hands ;-)

Do you prefer that I file this one on bugzilla?

-- 
Enrico


Index: src/support/os_unix.C
===================================================================
--- src/support/os_unix.C       (revision 13450)
+++ src/support/os_unix.C       (working copy)
@@ -97,6 +97,12 @@ char path_separator()
 void cygwin_path_fix(bool)
 {}
 
+
+bool cygwin_path_fix()
+{
+       return false;
+}
+
 } // namespace os
 } // namespace support
 } // namespace lyx
Index: src/support/os.h
===================================================================
--- src/support/os.h    (revision 13450)
+++ src/support/os.h    (working copy)
@@ -65,6 +65,7 @@ char path_separator();
  *  under Cygwin.
  */
 void cygwin_path_fix(bool use_cygwin_paths);
+bool cygwin_path_fix();
 
 } // namespace os
 } // namespace support
Index: src/support/filetools.C
===================================================================
--- src/support/filetools.C     (revision 13450)
+++ src/support/filetools.C     (working copy)
@@ -86,7 +86,13 @@ 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, '/') && os::cygwin_path_fix())
+               path = 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
Index: src/support/os_win32.C
===================================================================
--- src/support/os_win32.C      (revision 13450)
+++ src/support/os_win32.C      (working copy)
@@ -265,6 +265,12 @@ void cygwin_path_fix(bool)
 {}
 
 
+bool cygwin_path_fix()
+{
+       return false;
+}
+
+
 namespace {
 
 void bail_out()
Index: src/support/os_cygwin.C
===================================================================
--- src/support/os_cygwin.C     (revision 13450)
+++ src/support/os_cygwin.C     (working copy)
@@ -146,6 +146,12 @@ void cygwin_path_fix(bool use_cygwin_pat
        cygwin_path_fix_ = use_cygwin_paths;
 }
 
+
+bool cygwin_path_fix()
+{
+       return cygwin_path_fix_;
+}
+
 } // namespace os
 } // namespace support
 } // namespace lyx
Index: src/support/os_os2.C
===================================================================
--- src/support/os_os2.C        (revision 13450)
+++ src/support/os_os2.C        (working copy)
@@ -212,6 +212,12 @@ char path_separator()
 void cygwin_path_fix(bool)
 {}
 
+
+bool cygwin_path_fix()
+{
+       return false;
+}
+
 } // namespace os
 } // namespace support
 } // namespace lyx


Reply via email to