diff liboctave/system/file-ops.cc @ 20560:3aea4200da40

maint: Periodic merger of stable to default.
author Rik <rik@octave.org>
date Mon, 28 Sep 2015 14:27:09 -0700
parents a9574e3c6e9e 0829b6ff3ac9
children
line wrap: on
line diff
--- a/liboctave/system/file-ops.cc	Sun Sep 27 17:12:29 2015 +0200
+++ b/liboctave/system/file-ops.cc	Mon Sep 28 14:27:09 2015 -0700
@@ -54,6 +54,10 @@
 #include "singleton-cleanup.h"
 #include "str-vec.h"
 
+#if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM))
+#include <algorithm>
+#endif
+
 file_ops *file_ops::instance = 0;
 
 bool
@@ -738,6 +742,11 @@
       free (tmp);
     }
 
+#if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM))
+  // Canonical Windows file separator is backslash.
+  std::replace (retval.begin (), retval.end (), '/', '\\');
+#endif
+
   if (retval.empty ())
     msg = gnulib::strerror (errno);