]> git.lyx.org Git - lyx.git/blobdiff - src/support/os_win32.cpp
an example for the sweave module, prepared by Gregor Gorjanc
[lyx.git] / src / support / os_win32.cpp
index 2e7b826203e4e15235831114f764f54bd9a82080..a204adfde094fe5b7b70fd0cbddcb181a863cedc 100644 (file)
@@ -252,8 +252,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.
 
-       FileName path(p);
-       if (!windows_style_tex_paths_ && path.isAbsolute()) {
+       if (!windows_style_tex_paths_ && FileName::isAbsolute(p)) {
                string const drive = p.substr(0, 2);
                string const cygprefix = cygdrive + "/" + drive.substr(0, 1);
                string const cygpath = subst(subst(p, '\\', '/'), drive, cygprefix);
@@ -297,6 +296,26 @@ string const & nulldev()
 }
 
 
+bool is_terminal(io_channel channel)
+{
+       switch (channel) {
+       case STDIN:
+               if (GetStdHandle(STD_INPUT_HANDLE) == NULL)
+                       return false;
+               break;
+       case STDOUT:
+               if (GetStdHandle(STD_OUTPUT_HANDLE) == NULL)
+                       return false;
+               break;
+       case STDERR:
+               if (GetStdHandle(STD_ERROR_HANDLE) == NULL)
+                       return false;
+               break;
+       }
+       return true;
+}
+
+
 shell_type shell()
 {
        return CMD_EXE;