Commit 47cfb5cd authored by bonnell's avatar bonnell
Browse files

Fix problem with windows launcher passing along arguments with special characters

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@27804 18c085ea-50e0-402c-830e-de6fd14e8384
parent cee88e76
......@@ -81,7 +81,9 @@ typedef vector<string> stringVector;
#define ENDSWITHQUOTE(A) (A[strlen(A)-1] == '\'' || A[strlen(A)-1] == '\"')
#define HASSPACE(A) (strstr(A, " ") != NULL)
#define SQUOTEARG(A) (tmpArg = string("\'") + string(A) + string("\'"))
#define HASANGLEBRACKET(A) (strstr(A, "<") != NULL || strstr(A, ">") != NULL)
#define HASSPECIAL(A) (HASSPACE(A) || HASANGLEBRACKET(A))
#define DQUOTEARG(A) (tmpArg = string("\"") + string(A) + string("\""))
/*
......@@ -287,6 +289,12 @@ static bool EndsWith(const char *s, const char *suffix)
* Kathleen Biagas, Tue Sep 29 15:51:12 MST 2015
* Add movie args before any others when running -movie.
*
* Kathleen Biagas, Tue Dec 15 13:30:47 MST 2015
* Add '<' and '>' to the list of special characters that indicate an
* argument needs to be re-surrounded by quotes when passing along to
* visit's components. Use double-quotes when re-surrounding instead of
* single.
*
*****************************************************************************/
int
......@@ -511,9 +519,9 @@ VisItLauncherMain(int argc, char *argv[])
}
else
{
if (!BEGINSWITHQUOTE(argv[i]) && HASSPACE(argv[i]))
if (!BEGINSWITHQUOTE(argv[i]) && HASSPECIAL(argv[i]))
{
SQUOTEARG(argv[i]);
DQUOTEARG(argv[i]);
componentArgs.push_back(tmpArg);
}
else if (BEGINSWITHQUOTE(argv[i]) && !ENDSWITHQUOTE(argv[i]))
......@@ -677,9 +685,9 @@ VisItLauncherMain(int argc, char *argv[])
}
if (!BEGINSWITHQUOTE(componentArgs[i].c_str()) &&
HASSPACE(componentArgs[i].c_str()))
HASSPECIAL(componentArgs[i].c_str()))
{
SQUOTEARG(componentArgs[i].c_str());
DQUOTEARG(componentArgs[i].c_str());
command.push_back(tmpArg);
}
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment