From: Michael Stapelberg Date: Fri, 21 Oct 2011 22:22:48 +0000 (+0100) Subject: Bugfix: fix off by one when copying the hex colorcode (Thanks fernandotcl) X-Git-Tag: 4.1~92^2~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9b84348201d2720e24712683d7030e781020be09;p=i3%2Fi3 Bugfix: fix off by one when copying the hex colorcode (Thanks fernandotcl) --- diff --git a/src/cfgparse.l b/src/cfgparse.l index 39e1d398..cd936ac5 100644 --- a/src/cfgparse.l +++ b/src/cfgparse.l @@ -138,7 +138,7 @@ EOL (\r?\n) [^\n]+ { yy_pop_state(); yylval.string = sstrdup(yytext); return STR; } [a-zA-Z0-9_-]+ { yy_pop_state(); yylval.string = sstrdup(yytext); return OUTPUT; } ^[ \t]*#[^\n]* { return TOKCOMMENT; } -#[0-9a-fA-F]+ { yy_pop_state(); yylval.string = sstrdup(yytext+1); return HEXCOLOR; } +#[0-9a-fA-F]+ { yy_pop_state(); yylval.string = sstrdup(yytext); return HEXCOLOR; } [ \t]*→[ \t]* { BEGIN(WANT_STRING); } [ \t]+ { BEGIN(WANT_STRING); } [0-9]+ { yylval.number = atoi(yytext); return NUMBER; }