summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/config.c b/config.c
index d18cc92..4eb536a 100644
--- a/config.c
+++ b/config.c
@@ -1461,7 +1461,7 @@ static void config_read_editorconfig(Ted *ted, RcStr *path_rc) {
config_compile_regex(cfg, reader);
break;
default: {
- char key[64] = {c};
+ char key[128] = {c};
for (size_t i = 1; i < sizeof key - 1; i++) {
c = config_getc(reader);
if (!c || c == '\n') break;
@@ -1469,18 +1469,14 @@ static void config_read_editorconfig(Ted *ted, RcStr *path_rc) {
key[i] = c;
}
if (c != '=') {
- config_err(reader, "expected key = value but didn't find =");
+ config_err(reader, "expected key = value but didn't find = (just have %s)", key);
break;
}
str_trim(key);
str_ascii_to_lowercase(key);
- char value[64] = {0};
- for (size_t i = 0; i < sizeof value - 1; i++) {
- c = config_getc(reader);
- if (!c || c == '\n') break;
- value[i] = c;
- }
- str_trim(value);
+ config_read_to_eol(reader, line, sizeof line);
+ str_trim(line);
+ char *value = line;
if (streq(key, "root")) {
str_ascii_to_lowercase(value);
if (cfg) {