+
+/// Format commandline used to start WinMerge
+CString CWinMergeShell::FormatCmdLine(const CString &winmergePath,
+ const CString &path1, const CString &path2)
+{
+ CString strCommandline = winmergePath;
+ BOOL bOnlyFiles = FALSE;
+
+ if (!path1.IsEmpty() && !path2.IsEmpty())
+ {
+ CFileStatus status;
+ CFileStatus status2;
+ if (CFile::GetStatus(path1, status) &&
+ CFile::GetStatus(path2, status2))
+ {
+ // Check if both paths are files
+ if ((status.m_attribute & CFile::Attribute::directory) == 0 &&
+ (status2.m_attribute & CFile::Attribute::directory) == 0)
+ {
+ bOnlyFiles = TRUE;
+ }
+ }
+ }
+
+ strCommandline += _T(" \"") +
+ path1 + _T("\"");
+
+ if (!m_strPaths[1].IsEmpty())
+ strCommandline += _T(" \"") + path2 + _T("\"");
+
+ return strCommandline;
+}