summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-24 12:39:45 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-24 12:39:45 -0500
commit33b951f3b5d89c0ba7e7c7d821a9eafb37088872 (patch)
treea5de2f26fe044f44f5b39fae9adac51395dae893 /main.c
parent68b77c7a1cde7344702cf1d162e0124498a6b616 (diff)
auto-cd: check if actually directory, ~
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.c b/main.c
index f04f984..ca8c991 100644
--- a/main.c
+++ b/main.c
@@ -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
}