File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -348,7 +348,7 @@ fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
348
348
if !full_version_line.trim().is_empty() => {
349
349
let full_version_line = full_version_line.trim();
350
350
351
- // used to be a regex "(^|[^0-9])([0-9]\.[0-9])([^0-9]|$ )"
351
+ // used to be a regex "(^|[^0-9])([0-9]\.[0-9]+ )"
352
352
for (pos, c) in full_version_line.char_indices() {
353
353
if !c.is_digit(10) { continue }
354
354
if pos + 2 >= full_version_line.len() { continue }
@@ -357,11 +357,12 @@ fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
357
357
if pos > 0 && full_version_line.char_at_reverse(pos).is_digit(10) {
358
358
continue
359
359
}
360
- if pos + 3 < full_version_line.len() &&
361
- full_version_line.char_at(pos + 3).is_digit(10) {
362
- continue
360
+ let mut end = pos + 3;
361
+ while end < full_version_line.len() &&
362
+ full_version_line.char_at(end).is_digit(10) {
363
+ end += 1;
363
364
}
364
- return Some(full_version_line[pos..pos+3 ].to_owned());
365
+ return Some(full_version_line[pos..end ].to_owned());
365
366
}
366
367
println!("Could not extract GDB version from line '{}'",
367
368
full_version_line);
You can’t perform that action at this time.
0 commit comments