From 131757aee93870feac06afca84de91a30fa1c658 Mon Sep 17 00:00:00 2001 From: jrodatus Date: Wed, 25 Feb 2026 16:49:02 -0500 Subject: [PATCH] Fix pasting files into drive roots --- src/file_actions.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/file_actions.c b/src/file_actions.c index 2b3af4e..fee6067 100644 --- a/src/file_actions.c +++ b/src/file_actions.c @@ -320,8 +320,11 @@ void pasteFiles(wchar_t* dstDir) { actionData = calloc(1, sizeof(struct ActionData)); int len = wcslen(dstDir); - actionData->dstPath = calloc(len + 2, sizeof(wchar_t)); + actionData->dstPath = calloc(len + 3, sizeof(wchar_t)); wcscpy_s(actionData->dstPath, len + 1, dstDir); + if (len == 2 && actionData->dstPath[len-1] == L':') { + actionData->dstPath[len++] = L'\\'; + } actionData->dstPath[len+0] = L'\0'; actionData->dstPath[len+1] = L'\0';