https://github.com/swaywm/sway.git
Revision e12b3667a94ce78adb974cb4f94d0ffbe58c4290 authored by Alyssa Ross on 16 May 2019, 22:56:58 UTC, committed by Drew DeVault on 21 May 2019, 14:16:26 UTC
Prior to this patch, if I ran something like this, sway would crash:

    swaymsg bar height 50

or

    swaymsg bar not-a-bar-id color bg #ff0000

This was in contrast to other bar subcommands, like status_command,
which would exit with a "No bar defined" message.

The difference between the subcommands that crashed and the ones that
exited was that some subcommands had a check to see if a bar was
specified, while others just assumed that it had been and carried on
until they segfaulted.

Because this check was identical in every subcommand it was present in,
and I couldn't think of a case where it would be valid to run a bar
subcommand without specifying which bar to apply it to, I moved this
check from individual subcommands into the bar command, which is already
responsible for actually setting the specified bar. This reduced code
duplication, and fixed the crash for the subcommands that were missing
this check.
1 parent b8f12b4
History
Tip revision: e12b3667a94ce78adb974cb4f94d0ffbe58c4290 authored by Alyssa Ross on 16 May 2019, 22:56:58 UTC
bar: fix segfault with missing or invalid bar id
Tip revision: e12b366
File Mode Size
.builds
assets
client
common
completions
contrib
include
protocols
security.d
sway
swaybar
swaymsg
swaynag
.clang-format -rw-r--r-- 405 bytes
.editorconfig -rw-r--r-- 315 bytes
.gitignore -rw-r--r-- 137 bytes
CONTRIBUTING.md -rw-r--r-- 7.9 KB
ISSUE_TEMPLATE.md -rw-r--r-- 1.5 KB
LICENSE -rw-r--r-- 1.0 KB
README.de.md -rw-r--r-- 2.4 KB
README.es.md -rw-r--r-- 2.2 KB
README.fr.md -rw-r--r-- 2.4 KB
README.ja.md -rw-r--r-- 3.1 KB
README.md -rw-r--r-- 2.6 KB
README.pl.md -rw-r--r-- 2.2 KB
README.uk.md -rw-r--r-- 3.8 KB
README.zh-CN.md -rw-r--r-- 1.8 KB
config.in -rw-r--r-- 6.6 KB
meson.build -rw-r--r-- 7.3 KB
meson_options.txt -rw-r--r-- 832 bytes
sway.desktop -rw-r--r-- 97 bytes

README.md

back to top