/**
* @brief Read paths and filter from project file.
+ *
+ * Tries to find project file in files[0] and files[1] by extension
+ * If cannot find one, returns FALSE
*/
BOOL CMergeApp::LoadProjectFile(CStringArray & files, BOOL & recursive)
{
CString ProjectFileName;
CString ext;
+ // Look for project file in files[0] and files[1]
+
+ if (files.GetSize() < 2)
+ return FALSE; // code further down assumes files[0] and files[1] exist
+
SplitFilename(files[0], NULL, NULL, &ext);
if (ext == PROJECTFILE_EXT)
+ {
ProjectFileName = files[0];
+ }
else
{
+ if (files.GetSize() == 1)
+ return FALSE;
SplitFilename(files[1], NULL, NULL, &ext);
if (ext == PROJECTFILE_EXT)
ProjectFileName = files[1];
return FALSE;
}
+ // We found project file, and stored it in ProjectFileName
+
if (!ProjectFileName.IsEmpty())
{
if (!pfile.Read(ProjectFileName, &err))
+2005-06-01 Perry
+ Add commenting & array bounds checking to CMergeApp::LoadProjectFile
+ Src: Merge.cpp
+
2005-06-01 Kimmo
PATCH: [ 1210059 ] Sanity check difference before merging it
Src: Merge.rc MergeDoc.cpp MergeDoc.h resource.h