From 6d8f61205d41d5e89235dbb7d4d0c3f1c9f27c26 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 28 Aug 2012 13:26:12 +0200 Subject: [PATCH] accept slashes in RandR output names (+test) (Thanks dbp) fixes #785 --- src/cfgparse.l | 2 +- testcases/t/196-randr-output-names.t | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 testcases/t/196-randr-output-names.t 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 <