diff --git a/stim/parser/filename.h b/stim/parser/filename.h index 7baf900..0188f92 100644 --- a/stim/parser/filename.h +++ b/stim/parser/filename.h @@ -110,12 +110,17 @@ protected: unix_dir = unix_dir.substr(2, unix_dir.length()-2); //extract the directory structure } - if(unix_dir[0] == '/'){ //if there is a leading slash - relative = false; //the path is not relative - unix_dir = unix_dir.substr(1, unix_dir.length() - 1); //remove the slash + if(drive.size() != 0){ + relative = false; + } + if(unix_dir.size() > 0){ //if there is a directory specified, remove surrounding slashes + if(unix_dir[0] == '/'){ //if there is a leading slash + relative = false; //the path is not relative + unix_dir = unix_dir.substr(1, unix_dir.length() - 1); //remove the slash + } + if(unix_dir[unix_dir.size()-1] == '/') + unix_dir = unix_dir.substr(0, unix_dir.length() - 1); } - if(unix_dir[unix_dir.size()-1] == '/') - unix_dir = unix_dir.substr(0, unix_dir.length() - 1); path = stim::parser::split(unix_dir, '/'); //split up the directory structure -- libgit2 0.21.4