]> git.lyx.org Git - features.git/commitdiff
Fix latex_path on cygwin:
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 24 Mar 2006 12:48:37 +0000 (12:48 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 24 Mar 2006 12:48:37 +0000 (12:48 +0000)
        * src/support/os.h
        * src/support/os_unix.C
        * src/support/os_win32.C
        * src/support/os_cygwin.C
        (latex_path): new function, handle the OS-specific part of
        lyx::support::latex_path

        * src/support/filetools.C
        (latex_path): use lyx::os::support::latex_path (bug 2409)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13474 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/filetools.C
src/support/os.h
src/support/os_cygwin.C
src/support/os_unix.C
src/support/os_win32.C

index 4b1fc8e791f85db6d36068bb263b9d3cf374e4b7..5a0a6d4bf6df0cd6ccb71aca9e11454168d119ab 100644 (file)
@@ -87,6 +87,8 @@ string const latex_path(string const & original_path,
                latex_path_dots dots)
 {
        string path = subst(original_path, "\\", "/");
+       // On cygwin, we may need windows or posix style paths.
+       path = os::latex_path(path);
        path = subst(path, "~", "\\string~");
        if (path.find(' ') != string::npos) {
                // We can't use '"' because " is sometimes active (e.g. if
index f9517dcc3982b50f71f752d42fb743d7a06f37b1..85e97bfa857f28949f9bfc14c5b2b0cdcec864c9 100644 (file)
@@ -47,6 +47,14 @@ std::string external_path(std::string const & p);
 /// Converts a host OS style path to unix style.
 std::string internal_path(std::string const & p);
 
+/**
+ * Converts a unix style path into a form suitable for inclusion in a LaTeX
+ * document.
+ * Caution: This function handles only the OS specific part of that task.
+ * Never use it directly, use lyx::support::latex_path instead.
+ */
+std::string latex_path(std::string const & p);
+
 /// Is the path absolute?
 bool is_absolute_path(std::string const & p);
 
index 0961606f1de2083cba2d508836558bb0daae877c..dce059d40b49b84c712710d54f208c87ff8662a0 100644 (file)
@@ -102,6 +102,15 @@ string internal_path(string const & p)
 }
 
 
+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.
+       return external_path(p);
+}
+
+
 bool is_absolute_path(string const & p)
 {
        if (p.empty())
index 28235773133e77f33720950e0d7e651b420f485f..d53b9345a52a6098231e336148eda408eeb7b4db 100644 (file)
@@ -63,6 +63,12 @@ string internal_path(string const & p)
 }
 
 
+string latex_path(string const & p)
+{
+       return p;
+}
+
+
 bool is_absolute_path(string const & p)
 {
        return !p.empty() && p[0] == '/';
index 462f6fe3c4351ae0e0caba264275840236a1cc33..db823e522019966895f9fa1dcc692bb151731d17 100644 (file)
@@ -216,6 +216,12 @@ string internal_path(string const & p)
 }
 
 
+string latex_path(string const & p)
+{
+       return p;
+}
+
+
 // (Claus H.) On Win32 both Unix and Win32/DOS pathnames are used.
 // Therefore an absolute path could be either a pathname starting
 // with a slash (Unix) or a pathname starting with a drive letter