"Move to recycle bin" for Windows is now ready for the tests.

This commit is contained in:
dolphin6k 2021-10-31 17:18:16 +09:00
parent f9efb48450
commit 2a6b55e3c2
2 changed files with 3 additions and 6 deletions

View file

@ -358,9 +358,9 @@ static void mtw(wchar_t * wtok, char *tok, size_t size)
iconv_close(trans); iconv_close(trans);
} }
//#define USE_WINDOWS_RECYCLE_BIN #define USE_WINDOWS_RECYCLE_BIN
#ifdef USE_WINDOWS_RECYCLE_BIN #ifdef USE_WINDOWS_RECYCLE_BIN
extern int win32_trash(char *path); extern int win32_trash(const char *path);
#endif #endif
#endif /* WIN32 */ #endif /* WIN32 */

View file

@ -24,14 +24,11 @@ int MoveFileToRecycleBin(const TCHAR *fullPathName)
int win32_trash(const char *path) int win32_trash(const char *path)
{ {
char *p, *src; char *p, *src;
int ret;
src = p = strdup(path); src = p = strdup(path);
while(*p != '\0'){ while(*p != '\0'){
if (*p == '/') *p = '\\'; if (*p == '/') *p = '\\';
p++; p++;
} }
ret = MoveFileToRecycleBin(src); return MoveFileToRecycleBin(src);
free(p);
return ret;
} }