]> git.lyx.org Git - lyx.git/blobdiff - src/support/os_cygwin.cpp
Now that exceptions are allowed, handle gracefully the case where a Buffer temp direc...
[lyx.git] / src / support / os_cygwin.cpp
index 450b99834652c2fe6eaef1b7b45340f1f399905a..cfaeb549f6330277b3de6e5b0b2c50c06bdc3530 100644 (file)
 #include <config.h>
 
 #include "support/os.h"
-#include "support/lstrings.h"
 
-#include "debug.h"
+#include "support/FileName.h"
+#include "support/lstrings.h"
+#include "support/debug.h"
 
 #include <windows.h>
 #include <io.h>
@@ -27,9 +28,7 @@
 
 #include <sys/cygwin.h>
 
-using std::endl;
-using std::string;
-
+using namespace std;
 
 namespace lyx {
 namespace support {
@@ -189,7 +188,7 @@ string latex_path(string const & p)
        // on windows_style_tex_paths_), but we use always forward slashes,
        // since it gets written into a .tex file.
 
-       if (windows_style_tex_paths_ && is_absolute_path(p)) {
+       if (windows_style_tex_paths_ && FileName(p).isAbsolute()) {
                string dos_path = convert_path(p, PathStyle(windows));
                LYXERR(Debug::LATEX, "<Path correction for LaTeX> ["
                        << p << "]->>[" << dos_path << ']');
@@ -200,18 +199,6 @@ string latex_path(string const & p)
 }
 
 
-bool is_absolute_path(string const & p)
-{
-       if (p.empty())
-               return false;
-
-       bool isDosPath = (p.length() > 1 && p[1] == ':');
-       bool isUnixPath = (p[0] == '/');
-
-       return isDosPath || isUnixPath;
-}
-
-
 // returns a string suitable to be passed to popen when
 // reading a pipe
 char const * popen_read_mode()