mirror of
https://github.com/swaywm/sway.git
synced 2025-02-22 01:45:38 +01:00
swaynag: remove trailing newlines in config
Now that swaynag uses getline (instead of the old readline), the trailing newline characters have to be removed when reading the config
This commit is contained in:
parent
df3ea6a55f
commit
66062f53de
1 changed files with 4 additions and 0 deletions
|
@ -348,6 +348,10 @@ int swaynag_load_config(char *path, struct swaynag *swaynag, list_t *types) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (line[nread - 1] == '\n') {
|
||||||
|
line[nread - 1] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
if (line[0] == '[') {
|
if (line[0] == '[') {
|
||||||
char *close = strchr(line, ']');
|
char *close = strchr(line, ']');
|
||||||
if (!close) {
|
if (!close) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue