"Move to recycle bin" for Windows is now ready for the tests.
This commit is contained in:
parent
f9efb48450
commit
2a6b55e3c2
2 changed files with 3 additions and 6 deletions
|
|
@ -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 */
|
||||||
|
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue