]> git.lyx.org Git - lyx.git/blobdiff - src/support/filename.C
make "make distcheck" work
[lyx.git] / src / support / filename.C
index a36af32567bc2ab16adbc6fc728a740e68238e59..3f5020f46b62519d81291a1ab0d3d2252b069d0d 100644 (file)
 
 #include <config.h>
 
-#include "filename.h"
-
-#include "filetools.h"
-#include "lstrings.h"
-#include "os.h"
+#include "support/filename.h"
+#include "support/filetools.h"
+#include "support/lstrings.h"
+#include "support/os.h"
 
 #include <boost/assert.hpp>
 
@@ -78,7 +77,7 @@ string const FileName::mangledFilename() const
                return (*it).second;
 
        // Now the real work
-       string mname = os::slashify_path(name_);
+       string mname = os::internal_path(name_);
        // Remove the extension.
        mname = ChangeExtension(name_, string());
        // Replace '/' in the file name with '_'
@@ -87,6 +86,13 @@ string const FileName::mangledFilename() const
        mname = subst(mname, ".", "_");
        // Add the extension back on
        mname = ChangeExtension(mname, GetExtension(name_));
+
+#if defined(__CYGWIN__) || defined(__CYGWIN32__) || defined(_WIN32)
+       // Mangle the drive letter in a Windows-style path.
+       if (mname.size() >= 2 && mname[1] == ':')
+               mname[1] = '_';
+#endif
+
        // Prepend a counter to the filename. This is necessary to make
        // the mangled name unique.
        static int counter = 0;