This commit is contained in:
Justin M. Keyes
2024-09-01 13:01:24 -07:00
committed by GitHub
parent 6913c5e1d9
commit 61e9137394
19 changed files with 91 additions and 83 deletions

View File

@@ -1434,9 +1434,9 @@ scripterror:
// On Windows expand "~\" or "~/" prefix in file names to profile directory.
#ifdef MSWIN
if (*p == '~' && (p[1] == '\\' || p[1] == '/')) {
size_t size = strlen(os_get_homedir()) + strlen(p);
size_t size = strlen(os_homedir()) + strlen(p);
char *tilde_expanded = xmalloc(size);
snprintf(tilde_expanded, size, "%s%s", os_get_homedir(), p + 1);
snprintf(tilde_expanded, size, "%s%s", os_homedir(), p + 1);
xfree(p);
p = tilde_expanded;
}