From 2a6b55e3c238d3f70c84834052fe0f1d9d08ec30 Mon Sep 17 00:00:00 2001 From: dolphin6k Date: Sun, 31 Oct 2021 17:18:16 +0900 Subject: [PATCH] "Move to recycle bin" for Windows is now ready for the tests. --- src/tuxpaint.c | 4 ++-- src/win32_trash.c | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 6659cae26..9ccc51f75 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -358,9 +358,9 @@ static void mtw(wchar_t * wtok, char *tok, size_t size) iconv_close(trans); } -//#define USE_WINDOWS_RECYCLE_BIN +#define USE_WINDOWS_RECYCLE_BIN #ifdef USE_WINDOWS_RECYCLE_BIN -extern int win32_trash(char *path); +extern int win32_trash(const char *path); #endif #endif /* WIN32 */ diff --git a/src/win32_trash.c b/src/win32_trash.c index ca5cb9262..c089e8c6d 100644 --- a/src/win32_trash.c +++ b/src/win32_trash.c @@ -24,14 +24,11 @@ int MoveFileToRecycleBin(const TCHAR *fullPathName) int win32_trash(const char *path) { char *p, *src; - int ret; src = p = strdup(path); while(*p != '\0'){ if (*p == '/') *p = '\\'; p++; } - ret = MoveFileToRecycleBin(src); - free(p); - return ret; + return MoveFileToRecycleBin(src); }