BUG/MINOR: tools: fix parsing "us" unit for timers

Commit c20ad0d8dbd1bb5707bbfe23632415c3062e046c (BUG/MINOR: tools:  make
parse_time_err() more strict on the timer validity) broke parsing the "us"
unit in timers. It caused `parse_time_err()` to return the string "s",
which indicates an error.

Now if the "u" is followed by an "s" we properly continue processing the
time instead of immediately failing.

This fixes #1209. It must be backported to all stable versions.
This commit is contained in:
Thayne McCombs 2021-04-02 14:12:43 -06:00 committed by Christopher Faulet
parent eccb31c939
commit a68380524b

View File

@ -2326,6 +2326,7 @@ const char *parse_time_err(const char *text, unsigned *ret, unsigned unit_flags)
if (text[1] == 's') { if (text[1] == 's') {
idiv = 1000000; idiv = 1000000;
text++; text++;
break;
} }
return text; return text;
case 'm': /* millisecond : "ms" or minute: "m" */ case 'm': /* millisecond : "ms" or minute: "m" */