Skip to content

Commit b94c4f5

Browse files
committed
Auto merge of #28638 - wthrowe:gdb-version, r=alexcrichton
GDB 7.10 was recently released.
2 parents 6645ca1 + 1e0c23d commit b94c4f5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/compiletest/compiletest.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
348348
if !full_version_line.trim().is_empty() => {
349349
let full_version_line = full_version_line.trim();
350350

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]+)"
352352
for (pos, c) in full_version_line.char_indices() {
353353
if !c.is_digit(10) { continue }
354354
if pos + 2 >= full_version_line.len() { continue }
@@ -357,11 +357,12 @@ fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
357357
if pos > 0 && full_version_line.char_at_reverse(pos).is_digit(10) {
358358
continue
359359
}
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;
363364
}
364-
return Some(full_version_line[pos..pos+3].to_owned());
365+
return Some(full_version_line[pos..end].to_owned());
365366
}
366367
println!("Could not extract GDB version from line '{}'",
367368
full_version_line);

0 commit comments

Comments
 (0)