File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -55,19 +55,26 @@ void RPCExecutor::start()
55
55
void RPCExecutor::request (const QString &command)
56
56
{
57
57
// Parse shell-like command line into separate arguments
58
- boost::escaped_list_separator<char > els (' \\ ' ,' ' ,' \" ' );
59
- std::string strCommand = command.toStdString ();
60
- boost::tokenizer<boost::escaped_list_separator<char > > tok (strCommand, els);
61
-
62
58
std::string strMethod;
63
59
std::vector<std::string> strParams;
64
- int n = 0 ;
65
- for (boost::tokenizer<boost::escaped_list_separator<char > >::iterator beg=tok.begin (); beg!=tok.end ();++beg,++n)
60
+ try {
61
+ boost::escaped_list_separator<char > els (' \\ ' ,' ' ,' \" ' );
62
+ std::string strCommand = command.toStdString ();
63
+ boost::tokenizer<boost::escaped_list_separator<char > > tok (strCommand, els);
64
+
65
+ int n = 0 ;
66
+ for (boost::tokenizer<boost::escaped_list_separator<char > >::iterator beg=tok.begin (); beg!=tok.end ();++beg,++n)
67
+ {
68
+ if (n == 0 ) // First parameter is the command
69
+ strMethod = *beg;
70
+ else
71
+ strParams.push_back (*beg);
72
+ }
73
+ }
74
+ catch (boost::escaped_list_error &e)
66
75
{
67
- if (n == 0 ) // First parameter is the command
68
- strMethod = *beg;
69
- else
70
- strParams.push_back (*beg);
76
+ emit reply (RPCConsole::CMD_ERROR, QString (" Parse error" ));
77
+ return ;
71
78
}
72
79
73
80
try {
You can’t perform that action at this time.
0 commit comments