summaryrefslogtreecommitdiff
path: root/indra/newview/llcommandlineparser.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-11-11 23:34:37 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-11-11 23:34:37 +0200
commit92af5af736c2d6f3ac2f3ae5539da4bdea22e2a5 (patch)
tree888a19c6343d37ff1fc8fd22362799c143671a93 /indra/newview/llcommandlineparser.cpp
parentb1f84f13a8a1d0404e4593ac413b66af8d135f40 (diff)
parent04c473ab46041133ea6a87dbe0d43e662472adf5 (diff)
Merge branch 'master' (DRTVWR-507-maint) into DRTVWR-521-maint
# Conflicts: # autobuild.xml # indra/llcommon/llerror.cpp
Diffstat (limited to 'indra/newview/llcommandlineparser.cpp')
-rw-r--r--indra/newview/llcommandlineparser.cpp31
1 files changed, 19 insertions, 12 deletions
diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp
index fe14bc081f..06d959ba3c 100644
--- a/indra/newview/llcommandlineparser.cpp
+++ b/indra/newview/llcommandlineparser.cpp
@@ -402,23 +402,30 @@ bool LLCommandLineParser::parseCommandLineString(const std::string& str)
}
}
- // Split the string content into tokens
- const char* escape_chars = "\\";
- const char* separator_chars = "\r\n ";
- const char* quote_chars = "\"'";
- boost::escaped_list_separator<char> sep(escape_chars, separator_chars, quote_chars);
- boost::tokenizer< boost::escaped_list_separator<char> > tok(cmd_line_string, sep);
std::vector<std::string> tokens;
- // std::copy(tok.begin(), tok.end(), std::back_inserter(tokens));
- for(boost::tokenizer< boost::escaped_list_separator<char> >::iterator i = tok.begin();
- i != tok.end();
- ++i)
+ try
{
- if(0 != i->size())
+ // Split the string content into tokens
+ const char* escape_chars = "\\";
+ const char* separator_chars = "\r\n ";
+ const char* quote_chars = "\"'";
+ boost::escaped_list_separator<char> sep(escape_chars, separator_chars, quote_chars);
+ boost::tokenizer< boost::escaped_list_separator<char> > tok(cmd_line_string, sep);
+ // std::copy(tok.begin(), tok.end(), std::back_inserter(tokens));
+ for (boost::tokenizer< boost::escaped_list_separator<char> >::iterator i = tok.begin();
+ i != tok.end();
+ ++i)
{
- tokens.push_back(*i);
+ if (0 != i->size())
+ {
+ tokens.push_back(*i);
+ }
}
}
+ catch (...)
+ {
+ CRASH_ON_UNHANDLED_EXCEPTION(STRINGIZE("Unexpected crash while parsing: " << str));
+ }
po::command_line_parser clp(tokens);
return parseAndStoreResults(clp);