diff --git a/parser-specs/config.spec b/parser-specs/config.spec index b62491ed3..30d3d6870 100644 --- a/parser-specs/config.spec +++ b/parser-specs/config.spec @@ -400,8 +400,6 @@ state BINDCOMMAND: -> command = string -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command) - end - -> call cfg_binding($bindtype, $modifiers, $key, $release, $border, $whole_window, $exclude_titlebar, $command) ################################################################################ # Mode configuration diff --git a/release-notes/bugfixes/7-fix-segfault b/release-notes/bugfixes/7-fix-segfault new file mode 100644 index 000000000..5c280beef --- /dev/null +++ b/release-notes/bugfixes/7-fix-segfault @@ -0,0 +1 @@ +Fix segfault if command in bindsym is empty diff --git a/testcases/t/546-empty-bindcommand.t b/testcases/t/546-empty-bindcommand.t new file mode 100644 index 000000000..dae262935 --- /dev/null +++ b/testcases/t/546-empty-bindcommand.t @@ -0,0 +1,31 @@ +#!perl +# vim:ts=4:sw=4:expandtab +# +# Please read the following documents before working on tests: +# • https://build.i3wm.org/docs/testsuite.html +# (or docs/testsuite) +# +# • https://build.i3wm.org/docs/lib-i3test.html +# (alternatively: perldoc ./testcases/lib/i3test.pm) +# +# • https://build.i3wm.org/docs/ipc.html +# (or docs/ipc) +# +# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf +# (unless you are already familiar with Perl) +# +# Test that i3 doesn't crash if the binding command is empty. +# Ticket: #5000 + +use i3test i3_autostart => 0; + +my $config = <