aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/os/os2/user_posix.odin24
1 files changed, 12 insertions, 12 deletions
diff --git a/core/os/os2/user_posix.odin b/core/os/os2/user_posix.odin
index 691745b7a..09134d847 100644
--- a/core/os/os2/user_posix.odin
+++ b/core/os/os2/user_posix.odin
@@ -2,7 +2,6 @@
package os2
import "base:runtime"
-import "core:encoding/ini"
import "core:strings"
_user_cache_dir :: proc(allocator: runtime.Allocator) -> (dir: string, err: Error) {
@@ -157,18 +156,19 @@ _xdg_user_dirs_lookup :: proc(xdg_key: string, allocator: runtime.Allocator) ->
user_dirs_path := concatenate({config_dir, "/user-dirs.dirs"}, temp_allocator) or_return
content := read_entire_file(user_dirs_path, temp_allocator) or_return
- it := ini.Iterator{
- section = "",
- _src = string(content),
- options = ini.Options{
- comment = "#",
- key_lower_case = false,
- },
- }
+ xdg_dirs := string(content)
+ for line in strings.split_lines_iterator(&xdg_dirs) {
+ if len(line) > 0 && line[0] == '#' {
+ continue
+ }
- for k, v in ini.iterate(&it) {
- if k == xdg_key {
- return replace_environment_placeholders(v, allocator), nil
+ equals := strings.index(line, "=")
+ if equals > -1 {
+ if line[:equals] == xdg_key {
+ // Unquote to return a bare path string as we do on Windows
+ val := strings.trim(line[equals+1:], "\"")
+ return replace_environment_placeholders(val, allocator), nil
+ }
}
}
return