From: Michael Stapelberg Date: Sat, 22 Sep 2012 12:21:35 +0000 (+0200) Subject: cfgparse: be forgiving about a missing "ms" after a duration X-Git-Tag: 4.4~140 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c69fba36627fda5000ce777bda922a77c9c9ff1e;p=i3%2Fi3 cfgparse: be forgiving about a missing "ms" after a duration 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). --- 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: