From c69fba36627fda5000ce777bda922a77c9c9ff1e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 22 Sep 2012 14:21:35 +0200 Subject: [PATCH] cfgparse: be forgiving about a missing "ms" after a duration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While it’s certainly better and clearer to specify it, we should do the right thing when the unit is missing, just like CSS for example (margin: 0; is okay, margin: 0px; too). --- src/cfgparse.y | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cfgparse.y b/src/cfgparse.y index bcd7d20c..c3efb063 100644 --- a/src/cfgparse.y +++ b/src/cfgparse.y @@ -1057,7 +1057,8 @@ word_or_number: ; duration: - NUMBER TOK_TIME_MS { sasprintf(&$$, "%d", $1); } + NUMBER { sasprintf(&$$, "%d", $1); } + | NUMBER TOK_TIME_MS { sasprintf(&$$, "%d", $1); } ; mode: