diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-24 12:39:45 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-01-24 12:39:45 -0500 |
commit | 33b951f3b5d89c0ba7e7c7d821a9eafb37088872 (patch) | |
tree | a5de2f26fe044f44f5b39fae9adac51395dae893 /main.c | |
parent | 68b77c7a1cde7344702cf1d162e0124498a6b616 (diff) |
auto-cd: check if actually directory, ~
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -95,8 +95,15 @@ int main(int argc, char **argv) { strbuf_printf(ted_local_data_dir, "%ls" PATH_SEPARATOR_STR "ted", appdata); CoTaskMemFree(appdata); } + id = FOLDERID_Profile; + wchar_t *home = NULL; + if (SHGetKnownFolderPath(&id, 0, NULL, &home) == S_OK) { + strbuf_printf(ted_home, "%ls", home); + CoTaskMemFree(home); + } #else char *home = getenv("HOME"); + strbuf_printf(ted_home, "%s", home); strbuf_printf(ted_local_data_dir, "%s/.local/share/ted", home); #endif } |