Browse Source

BUG: if the path to your source directory has a -S in it, it will be picked up as the source directory by the command line parser, because it matches -S at any character position in the argements. Bad, should have used getopt, except that it is not cross platform.

Dan Blezek 25 years ago
parent
commit
0cfdc33d4a
1 changed files with 3 additions and 3 deletions
  1. 3 3
      Source/CMakeBuildTargets.cxx

+ 3 - 3
Source/CMakeBuildTargets.cxx

@@ -23,19 +23,19 @@ main(int ac, char** av)
       {
       std::string arg = av[i];
       // Set the current source directory with a -S dir options
-      if(arg.find("-S",0) != std::string::npos)
+      if(arg.find("-S",0) == 0)
 	{
 	std::string path = arg.substr(2);
 	mf.SetCurrentDirectory(path.c_str());
 	}
       // Set the output or binary directory with a -B dir option
-      if(arg.find("-B",0) != std::string::npos)
+      if(arg.find("-B",0) == 0)
 	{
 	std::string path = arg.substr(2);
 	mf.SetOutputHomeDirectory(path.c_str());
 	}
       // Set the source home directory with a -H dir option
-      if(arg.find("-H",0) != std::string::npos)
+      if(arg.find("-H",0) == 0)
 	{
 	std::string path = arg.substr(2);
 	mf.SetHomeDirectory(path.c_str());