Browse Source

fixed a bug writing to config files where it would use a brace instead of a bracket when creating a section

jp9000 12 years ago
parent
commit
a4055e4257
1 changed files with 3 additions and 1 deletions
  1. 3 1
      libobs/util/config-file.c

+ 3 - 1
libobs/util/config-file.c

@@ -244,6 +244,8 @@ int config_open(config_t *config, const char *file,
 
 	*config = bmalloc(sizeof(struct config_data));
 	memset(*config, 0, sizeof(struct config_data));
+	(*config)->file = bstrdup(file);
+
 	errorcode = config_parse(&(*config)->sections, file, always_open);
 
 	if (errorcode != CONFIG_SUCCESS) {
@@ -284,7 +286,7 @@ int config_save(config_t config)
 
 		if (i) dstr_cat(&str, "\n");
 
-		dstr_cat(&str, "{");
+		dstr_cat(&str, "[");
 		dstr_cat(&str, section->name);
 		dstr_cat(&str, "]\n");