summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-03-02 09:53:11 -0500
committerpommicket <pommicket@gmail.com>2023-03-02 09:53:11 -0500
commit595cc50b7985ec67c49c6e2ffc649cb04692a318 (patch)
tree970ab71aadabc9f0f0a7a1634512c31aedd23188 /config.c
parent6d9ebc8332b6cc54ada4bc17689e4de4040892c6 (diff)
dynamic language registration working
Diffstat (limited to 'config.c')
-rw-r--r--config.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/config.c b/config.c
index f19603a..c5f6c31 100644
--- a/config.c
+++ b/config.c
@@ -834,6 +834,10 @@ static void config_parse_line(ConfigReader *cfg, Settings **applicable_settings,
char *p = exts;
while (*p) {
+ while (*p == ',')
+ ++p;
+ if (*p == '\0')
+ break;
size_t len = strcspn(p, ",");
LanguageExtension *ext = arr_addp(settings->language_extensions);
ext->language = lang;
@@ -1029,7 +1033,8 @@ void config_parse(Ted *ted, ConfigPart **pparts) {
arr_free(languages);
arr_foreach_ptr(parts, ConfigPart, part) {
-
+ cfg->filename = part->file;
+ cfg->line_number = part->line;
arr_add(part->text, '\0'); // null termination
char *line = part->text;
while (*line) {