File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -228,28 +228,36 @@ bool ModemClass::buf_read(const string &prompt, string &data_res) {
228228 }
229229 else {
230230 if (string::npos != data_res.rfind (RESULT_DATA)) {
231- found = true ;
232231 data_res = data_res.substr (0 , data_res.length () - (sizeof (RESULT_DATA) - 1 ));
233232 if (prompt != DO_NOT_CHECK_CMD) {
234233 if (removeAtBegin (data_res, prompt)) {
235234 res = true ;
235+ found = true ;
236+ } else {
237+ data_res.clear ();
238+ continue ;
236239 }
237240 }
238241 else {
239242 res = true ;
243+ found = true ;
240244 }
241245 break ;
242246 }
243247 else if (string::npos != data_res.rfind (RESULT_OK)){
244- found = true ;
245248 data_res = data_res.substr (0 , data_res.length () - (sizeof (RESULT_OK) - 1 ) );
246249 if (prompt != DO_NOT_CHECK_CMD) {
247250 if (removeAtBegin (data_res, prompt)) {
248251 res = true ;
252+ found = true ;
253+ } else {
254+ data_res.clear ();
255+ continue ;
249256 }
250257 }
251258 else {
252259 res = true ;
260+ found = true ;
253261 }
254262 break ;
255263 }
You can’t perform that action at this time.
0 commit comments