diff options
author | Michael Pavone <pavone@retrodev.com> | 2019-01-03 19:30:41 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2019-01-03 19:30:41 -0800 |
commit | 0cd5890cd283b2ae6b5e2af37f6dde87a6bfe5e8 (patch) | |
tree | e5b0c19541dada52a8d32e6b7110b46b9a5a03b4 /paths.c | |
parent | 0eef3b4680016d82feb17f6b8403c4be52b96ed9 (diff) |
Fix Windows implentation of get_config_dir() so config file gets saved to the right place. Fix location for sticky_path file on all platforms
Diffstat (limited to 'paths.c')
-rw-r--r-- | paths.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -7,8 +7,7 @@ static char **current_path; static void persist_path(void) { - char const *parts[] = {get_userdata_dir(), PATH_SEP, "sticky_path"}; - char *pathfname = alloc_concat_m(3, parts); + char *pathfname = alloc_concat(get_userdata_dir(), PATH_SEP "blastem" PATH_SEP "sticky_path"); FILE *f = fopen(pathfname, "wb"); if (f) { if (fwrite(*current_path, 1, strlen(*current_path), f) != strlen(*current_path)) { @@ -63,8 +62,7 @@ void get_initial_browse_path(char **dst) *dst = NULL; char *remember_path = tern_find_path(config, "ui\0remember_path\0", TVAL_PTR).ptrval; if (!remember_path || !strcmp("on", remember_path)) { - char const *parts[] = {get_userdata_dir(), PATH_SEP, "sticky_path"}; - char *pathfname = alloc_concat_m(3, parts); + char *pathfname = alloc_concat(get_userdata_dir(), PATH_SEP "blastem" PATH_SEP "sticky_path"); FILE *f = fopen(pathfname, "rb"); if (f) { long pathsize = file_size(f); |