Skip to content
Snippets Groups Projects
Commit 05708914 authored by Fons Rademakers's avatar Fons Rademakers
Browse files

From Axel:

fix in conversion of cygpath to windows path.


git-svn-id: http://root.cern.ch/svn/root/trunk@36823 27541ba8-7e3a-0410-8455-c3a389f83636
parent 3c67b90c
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ static const char *GetCygwinRootDir() {
static bool FromCygToNativePath(std::string& path) {
// Convert a cygwin path (/cygdrive/x/...,/home)
// to a native Windows path. Return whether the path was changed.
static std::string cygRoot;
size_t posCygDrive = path.find("/cygdrive/");
if (posCygDrive != std::string::npos) {
path[posCygDrive] = path[posCygDrive + 10];
......@@ -45,13 +45,14 @@ static bool FromCygToNativePath(std::string& path) {
} else {
size_t posHome = path.find("/home/");
if (posHome != std::string::npos) {
std::string fname = GetCygwinRootDir();
if (fname[fname.length() - 1] == '/') {
fname += posHome + 1;
} else {
fname += posHome;
if (cygRoot.empty()) {
cygRoot = GetCygwinRootDir();
size_t len = cygRoot.length();
if (cygRoot[len - 1] == '/') {
cygRoot.erase(len - 1);
}
}
path = fname;
path.insert(posHome, cygRoot);
return true;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment