From: Michael Stapelberg Date: Tue, 28 Aug 2012 11:26:12 +0000 (+0200) Subject: accept slashes in RandR output names (+test) (Thanks dbp) X-Git-Tag: 4.3~53 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6d8f61205d41d5e89235dbb7d4d0c3f1c9f27c26;p=i3%2Fi3 accept slashes in RandR output names (+test) (Thanks dbp) fixes #785 --- diff --git a/src/cfgparse.l b/src/cfgparse.l index 04117624..52cde189 100644 --- a/src/cfgparse.l +++ b/src/cfgparse.l @@ -159,7 +159,7 @@ EOL (\r?\n) return STR; } [^\n]+ { yy_pop_state(); yylval.string = sstrdup(yytext); return STR; } -[a-zA-Z0-9_-]+ { yy_pop_state(); yylval.string = sstrdup(yytext); return OUTPUT; } +[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); return HEXCOLOR; } {EOL} { diff --git a/testcases/t/196-randr-output-names.t b/testcases/t/196-randr-output-names.t new file mode 100644 index 00000000..dfc288d9 --- /dev/null +++ b/testcases/t/196-randr-output-names.t @@ -0,0 +1,22 @@ +#!perl +# vim:ts=4:sw=4:expandtab +# Verify that i3 allows strange RandR output names such as DVI-I_1/digital. +# Ticket: #785 +# Bug still in: 4.2-256-ga007283 +use i3test i3_autostart => 0; +use File::Temp qw(tempfile); + +my ($fh, $filename) = tempfile(UNLINK => 1); +print $fh <