aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorIan Fan <ianfan0@gmail.com>2019-01-01 09:01:09 +0000
committerIan Fan <ianfan0@gmail.com>2019-01-01 09:01:25 +0000
commitbd35879e1cfda51accc68c9890980dce59eb006a (patch)
tree1fc93c731567ec13f4818ef42bb731dcef6277c3 /sway
parenta9c5158a77cc53a526ea0b16d99e476bd960e4a5 (diff)
fixup! config.c: re-enable backslash continuation in config file
Diffstat (limited to 'sway')
-rw-r--r--sway/config.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sway/config.c b/sway/config.c
index 4177ea10..9f32d44c 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -574,11 +574,7 @@ static ssize_t getline_with_cont(char **lineptr, size_t *line_size, FILE *file)
char *next_line = NULL;
size_t next_line_size = 0;
ssize_t nread = getline(lineptr, line_size, file);
- while (nread >= 2) {
- if (strcmp(&(*lineptr)[nread - 2], "\\\n") != 0) {
- break;
- }
-
+ while (nread >= 2 && strcmp(&(*lineptr)[nread - 2], "\\\n") == 0) {
ssize_t next_nread = getline(&next_line, &next_line_size, file);
if (next_nread == -1) {
break;
@@ -588,7 +584,7 @@ static ssize_t getline_with_cont(char **lineptr, size_t *line_size, FILE *file)
if ((ssize_t) *line_size < nread + 1) {
*line_size = nread + 1;
*lineptr = realloc(*lineptr, *line_size);
- if (!lineptr) {
+ if (!*lineptr) {
nread = -1;
break;
}