From 665381d30546b2a397190cdae5fd7125b3d442f8 Mon Sep 17 00:00:00 2001
From: Brian Ashworth <bosrsf04@gmail.com>
Date: Tue, 5 Feb 2019 00:31:06 -0500
Subject: 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
---
 swaynag/config.c | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'swaynag')

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) {
 			continue;
 		}
 
+		if (line[nread - 1] == '\n') {
+			line[nread - 1] = '\0';
+		}
+
 		if (line[0] == '[') {
 			char *close = strchr(line, ']');
 			if (!close) {
-- 
cgit v1.2.3