File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -504,7 +504,7 @@ class FromMsg {
504
504
}
505
505
}
506
506
int MasterSet () {
507
- std::string strOption = readPara ();
507
+ std::string strOption = readUntilSpace ();
508
508
if (strOption.empty ()) {
509
509
reply (" 有什么事么" + getName (fromQQ));
510
510
return -1 ;
@@ -974,7 +974,7 @@ class FromMsg {
974
974
else if (strLowerMessage.substr (intMsgCnt, 5 ) == " admin" )
975
975
{
976
976
intMsgCnt += 5 ;
977
- return AdminEvent (readPara ());
977
+ return AdminEvent (readUntilSpace ());
978
978
}
979
979
else if (strLowerMessage.substr (intMsgCnt, 5 ) == " coc7d" || strLowerMessage.substr (intMsgCnt, 4 ) == " cocd" )
980
980
{
@@ -3344,6 +3344,15 @@ class FromMsg {
3344
3344
void readSkipSpace () {
3345
3345
while (isspace (static_cast <unsigned char >(strLowerMessage[intMsgCnt])))intMsgCnt++;
3346
3346
}
3347
+ string readUntilSpace () {
3348
+ string strPara;
3349
+ readSkipSpace ();
3350
+ while (!isspace (static_cast <unsigned char >(strLowerMessage[intMsgCnt])) && intMsgCnt != strLowerMessage.length ()) {
3351
+ strPara += strMsg[intMsgCnt];
3352
+ intMsgCnt++;
3353
+ }
3354
+ return strPara;
3355
+ }
3347
3356
string readRest () {
3348
3357
readSkipSpace ();
3349
3358
return strMsg.substr (intMsgCnt);
You can’t perform that action at this time.
0 commit comments