Use system config path for config

This commit is contained in:
Krzosa Karol
2026-01-15 09:13:39 +01:00
parent 66483f6c99
commit f33c9873d0

View File

@@ -812,12 +812,6 @@ int main(int argc, char **argv)
WorkDir = GetWorkingDir(Perm); WorkDir = GetWorkingDir(Perm);
{ {
String sdl_config_path = SDL_GetPrefPath("krzosa", "text_editor"); String sdl_config_path = SDL_GetPrefPath("krzosa", "text_editor");
if (sdl_config_path.len && sdl_config_path.data[sdl_config_path.len - 1] == '\\') {
sdl_config_path = Chop(sdl_config_path, 1); // chop '/'
}
if (sdl_config_path.len && sdl_config_path.data[sdl_config_path.len - 1] == '/') {
sdl_config_path = Chop(sdl_config_path, 1); // chop '/'
}
ConfigDir = NormalizePath(Perm, sdl_config_path); ConfigDir = NormalizePath(Perm, sdl_config_path);
SDL_free(sdl_config_path.data); SDL_free(sdl_config_path.data);
} }
@@ -902,7 +896,7 @@ int main(int argc, char **argv)
} }
Scratch scratch; Scratch scratch;
GlobalConfigBufferID = LoadConfig(Format(scratch, "%S/config.te", GetExeDir(scratch))); GlobalConfigBufferID = LoadConfig(Format(scratch, "%S/config.te", ConfigDir));
for (int i = 1; i < argc; i += 1) { for (int i = 1; i < argc; i += 1) {
String it = argv[i]; String it = argv[i];
if (EndsWith(it, ".te")) { if (EndsWith(it, ".te")) {