aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-01-11 20:02:20 -0500
committerBrian Ashworth <bosrsf04@gmail.com>2019-01-11 20:02:20 -0500
commit39975ccfb53cf52b33c3d5d4b9aa17e0b50eb09f (patch)
treef528497ac94d46cff91be9ae9824a84cf968f8b5 /sway
parent33d9de88efa7642e20b37493ff60ad0e9689ea47 (diff)
config: do not reset pos when braces found
When a brace is found, the config file should not seek back to before the brace, otherwise the brace will be read multiple times.
Diffstat (limited to 'sway')
-rw-r--r--sway/config.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/config.c b/sway/config.c
index ea9f23dd..26d22842 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -613,7 +613,9 @@ static int detect_brace(FILE *file) {
}
}
free(line);
- fseek(file, pos, SEEK_SET);
+ if (ret == 0) {
+ fseek(file, pos, SEEK_SET);
+ }
return ret;
}