Skip to content

Commit

Permalink
Use shell instead of SHFileOperation
Browse files Browse the repository at this point in the history
The latter fails with long path names, and 'rd' is likely more complete than anything hand-rolled.
  • Loading branch information
smowton committed Apr 15, 2019
1 parent 5023acb commit 1d69e3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
21 changes: 0 additions & 21 deletions Source/incredimail_convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,27 +360,6 @@ char temp_version[5];

}

int DeleteDirectory(const char *sPath) {
SHFILEOPSTRUCT fileop;
int ret;

ZeroMemory( &fileop, sizeof( SHFILEOPSTRUCT ) );

fileop.hwnd = NULL;
fileop.wFunc = FO_DELETE;
fileop.pTo = NULL;
fileop.fFlags = FOF_NOCONFIRMATION|FOF_SILENT;
fileop.fAnyOperationsAborted = FALSE;
fileop.lpszProgressTitle = NULL;
fileop.hNameMappings = NULL;

fileop.pFrom = sPath;

ret = SHFileOperation(&fileop);

return( ret );
}

int ReadOneLine( HANDLE infile, char *buffer, int max_line_length ) {
DWORD byteread;
char byte;
Expand Down
6 changes: 5 additions & 1 deletion Source/winmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,4 +962,8 @@ enum INCREDIMAIL_VERSIONS incredimail_version;
}
}
email_thread = THREAD_COMPLETED;
}
}

int DeleteDirectory(const char *sPath) {
return system((std::string("rd /s /q \"") + sPath + "\"").c_str());
}

0 comments on commit 1d69e3c

Please sign in to comment.