scheduler: parse Android version strings of the form "(Android 9)"

(existing code only worked with a.b.c and a.b)
This commit is contained in:
David Anderson 2019-06-04 01:13:14 -07:00
parent 107bde9545
commit 7b87390365
1 changed files with 5 additions and 1 deletions

View File

@ -60,7 +60,7 @@ static double os_version_num(HOST h) {
return 0;
}
// parse "Android 4.3.1" or "Android 4.3"
// parse version# from "(Android 4.3.1)" or "(Android 4.3)" or "(Android 4)"
//
static int android_version_num(HOST h) {
int maj, min, rel;
@ -75,6 +75,10 @@ static int android_version_num(HOST h) {
if (n == 2) {
return maj*10000 + min*100;
}
n = sscanf(p, "%d", &maj);
if (n == 1) {
return maj*10000;
}
return 0;
}