diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-02-05 00:31:06 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-02-11 10:15:00 -0500 |
commit | 66062f53de5685eaf9ba28de6e08f236372f04b1 (patch) | |
tree | 9a6e64165bc5c008386555520073c2a111bff7fa | |
parent | load_include_configs: fix wordexp fail condition (diff) | |
download | sway-66062f53de5685eaf9ba28de6e08f236372f04b1.tar.gz sway-66062f53de5685eaf9ba28de6e08f236372f04b1.tar.zst sway-66062f53de5685eaf9ba28de6e08f236372f04b1.zip |
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
-rw-r--r-- | swaynag/config.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/swaynag/config.c b/swaynag/config.c index 40f3f65e..200611f4 100644 --- a/swaynag/config.c +++ b/swaynag/config.c | |||
@@ -348,6 +348,10 @@ int swaynag_load_config(char *path, struct swaynag *swaynag, list_t *types) { | |||
348 | continue; | 348 | continue; |
349 | } | 349 | } |
350 | 350 | ||
351 | if (line[nread - 1] == '\n') { | ||
352 | line[nread - 1] = '\0'; | ||
353 | } | ||
354 | |||
351 | if (line[0] == '[') { | 355 | if (line[0] == '[') { |
352 | char *close = strchr(line, ']'); | 356 | char *close = strchr(line, ']'); |
353 | if (!close) { | 357 | if (!close) { |