| 865 | } |
| 866 | |
| 867 | bool delete_file(const CryptContext *con, const WCHAR *filename, bool cleanup_longname_file_only) |
| 868 | { |
| 869 | if (!cleanup_longname_file_only && PathFileExists(filename)) { |
| 870 | if (!DeleteFile(filename)) |
| 871 | return false; |
| 872 | } |
| 873 | |
| 874 | if (!con->GetConfig()->m_PlaintextNames && con->GetConfig()->m_LongNames && is_long_name(filename)) { |
| 875 | |
| 876 | wstring path = filename; |
| 877 | |
| 878 | path += LONGNAME_SUFFIX_W; |
| 879 | |
| 880 | if (PathFileExists(&path[0])) { |
| 881 | if (DeleteFile(&path[0])) |
| 882 | return true; |
| 883 | else |
| 884 | return false; |
| 885 | } |
| 886 | |
| 887 | return true; |
| 888 | } else { |
| 889 | return true; |
| 890 | } |
| 891 | |
| 892 | } |
| 893 | #endif // _WIN32 |
| 894 | |
| 895 |
no test coverage detected