From b539fadc60b308950fbfa82f77f3a11621d3f0b8 Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Fri, 2 Apr 2021 14:12:43 -0600 Subject: [PATCH] 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. (cherry picked from commit a68380524b5b47cd77f5f4a47c1441b3c5b2cf93) Signed-off-by: Christopher Faulet (cherry picked from commit d5a8cec169845d6a54f1fc4800e6291d58aa6f36) Signed-off-by: Christopher Faulet (cherry picked from commit fc6bea24f545cf2ff5c9b0357c2d1edd978c7c06) Signed-off-by: Christopher Faulet --- src/standard.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/standard.c b/src/standard.c index ab429d8..085564b 100644 --- a/src/standard.c +++ b/src/standard.c @@ -2107,6 +2107,7 @@ const char *parse_time_err(const char *text, unsigned *ret, unsigned unit_flags) if (text[1] == 's') { idiv = 1000000; text++; + break; } return text; case 'm': /* millisecond : "ms" or minute: "m" */ -- 1.7.10.4