All the necessary machinery to activate it is already present in
configure and configure.py, so this simple patch to os_win32.C
allows using the cygwin tetex with a native win32 LyX.

Log:
        * src/support/os_win32.C: activate cygwin-tetex support

Do with it whatever you think fits better ;-)

-- 
Enrico
Index: src/support/os_win32.C
===================================================================
--- src/support/os_win32.C      (revision 13601)
+++ src/support/os_win32.C      (working copy)
@@ -191,6 +191,8 @@ string external_path(string const & p)
 
 namespace {
 
+bool cygwin_path_fix_ = false;
+
 string const get_long_path(string const & short_path)
 {
        std::vector<char> long_path(MAX_PATH);
@@ -230,6 +232,20 @@ string internal_path_list(string const &
 
 string latex_path(string const & p)
 {
+       // We may need a posix style path or a windows style path (depending
+       // on cygwin_path_fix_), but we use always forward slashes, since it
+       // gets written into a .tex file.
+
+       if (cygwin_path_fix_ && is_absolute_path(p)) {
+               string const drive = p.substr(0, 2);
+               string const cygdrive = "/cygdrive/" + drive.substr(0, 1);
+               string const dos_path = subst(subst(p, '\\', '/'), drive, 
cygdrive);
+               lyxerr[Debug::LATEX]
+                       << "<Cygwin path correction> ["
+                       << p << "]->>["
+                       << dos_path << ']' << endl;
+               return dos_path;
+       }
        return subst(p, '\\', '/');
 }
 
@@ -279,8 +295,10 @@ char path_separator()
 }
 
 
-void cygwin_path_fix(bool)
-{}
+void cygwin_path_fix(bool use_cygwin_paths)
+{
+       cygwin_path_fix_ = !use_cygwin_paths;
+}
 
 
 namespace {

Reply via email to