File tree 1 file changed +10
-2
lines changed
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) {
228
228
}
229
229
else {
230
230
if (string::npos != data_res.rfind (RESULT_DATA)) {
231
- found = true ;
232
231
data_res = data_res.substr (0 , data_res.length () - (sizeof (RESULT_DATA) - 1 ));
233
232
if (prompt != DO_NOT_CHECK_CMD) {
234
233
if (removeAtBegin (data_res, prompt)) {
235
234
res = true ;
235
+ found = true ;
236
+ } else {
237
+ data_res.clear ();
238
+ continue ;
236
239
}
237
240
}
238
241
else {
239
242
res = true ;
243
+ found = true ;
240
244
}
241
245
break ;
242
246
}
243
247
else if (string::npos != data_res.rfind (RESULT_OK)){
244
- found = true ;
245
248
data_res = data_res.substr (0 , data_res.length () - (sizeof (RESULT_OK) - 1 ) );
246
249
if (prompt != DO_NOT_CHECK_CMD) {
247
250
if (removeAtBegin (data_res, prompt)) {
248
251
res = true ;
252
+ found = true ;
253
+ } else {
254
+ data_res.clear ();
255
+ continue ;
249
256
}
250
257
}
251
258
else {
252
259
res = true ;
260
+ found = true ;
253
261
}
254
262
break ;
255
263
}
You can’t perform that action at this time.
0 commit comments