Permalink
Browse files

Checking for blank path to avoid error

  • Loading branch information...
1 parent 61649e9 commit 785fa9b5eed0e3ae110451a1eae204a190de36e0 @mothur-westcott mothur-westcott committed Feb 16, 2017
Showing with 5 additions and 7 deletions.
  1. +4 −6 source/engine.cpp
  2. +1 −1 source/mothurout.cpp
View
@@ -45,8 +45,7 @@ InteractEngine::InteractEngine(string path){
#ifdef MOTHUR_FILES
#else
//set default location to search for files to mothur's executable location. This will resolve issue of double-clicking on the executable which opens mothur and sets pwd to your home directory instead of the mothur directory and leads to "unable to find file" errors.
- string tempDefault = path.substr(0, (path.find_last_of('m')));
- if (tempDefault != "") { mout->setDefaultPath(tempDefault); }
+ if (path != "") { mout->setDefaultPath(path); }
#endif
}
@@ -184,8 +183,7 @@ BatchEngine::BatchEngine(string path, string batchFileName){
#ifdef MOTHUR_FILES
#else
//set default location to search for files to mothur's executable location. This will resolve issue of double-clicking on the executable which opens mothur and sets pwd to your home directory instead of the mothur directory and leads to "unable to find file" errors.
- string tempDefault = path.substr(0, (path.find_last_of('m')));
- if (tempDefault != "") { mout->setDefaultPath(tempDefault); }
+ if (path != "") { mout->setDefaultPath(path); }
#endif
@@ -321,8 +319,8 @@ ScriptEngine::ScriptEngine(string path, string commandString){
#ifdef MOTHUR_FILES
#else
//set default location to search for files to mothur's executable location. This will resolve issue of double-clicking on the executable which opens mothur and sets pwd to your home directory instead of the mothur directory and leads to "unable to find file" errors.
- string tempDefault = path.substr(0, (path.find_last_of('m')));
- if (tempDefault != "") { mout->setDefaultPath(tempDefault); }
+ //string tempDefault = path.substr(0, (path.find_last_of('m')));
+ if (path != "") { mout->setDefaultPath(path); }
#endif
View
@@ -1092,7 +1092,7 @@ string MothurOut::getFullPathName(string fileName){
//rip off first '/'
- string simpleCWD;
+ string simpleCWD; simpleCWD="";
if (cwd.length() > 0) { simpleCWD = cwd.substr(1); }
//break apart the current working directory

0 comments on commit 785fa9b

Please sign in to comment.