OSDN Git Service

BUG: [1994402] Crash when starting WinMerge with only one path
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sun, 15 Jun 2008 21:59:35 +0000 (21:59 +0000)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sun, 15 Jun 2008 21:59:35 +0000 (21:59 +0000)
Docs/Users/ChangeLog.txt
Src/WinMergeCmdLineParser.cpp

index f5c70d9..74a885d 100644 (file)
@@ -8,6 +8,7 @@ WinMerge 2.9.1.4
   BugFix: Temp paths in Reports created from archive file (#1984346)
   BugFix: ISL file syntax highlighting starts comment with { (#1981326)
   BugFix: Crash when starting a second instance (#1993835)
+  BugFix: Crash when starting WinMerge with only one path (#1994402)
 
 WinMerge 2.9.1.3 - 2008-06-05 (r5438)
   Update PCRE (regular expression library) to version 7.7 (#1941779)
index 80e7e23..e4a1aee 100644 (file)
@@ -252,16 +252,13 @@ void WinMergeCmdLineParser::ParseParam(const TCHAR* pszParam, BOOL bFlag,
                        {
                                file1 = m_cmdLineInfo.m_Files[0].Left(pos);
                                file2 = m_cmdLineInfo.m_Files[0].Mid(pos + 2);
-                       }
 
-                       // Remove possible parenthesis from end of second path.
-                       // Second path got split from first path.
-                       if (file2[file2.GetLength() - 1] == '\"')
-                               file2.Delete(file2.GetLength() - 1, 1);
+                               // Remove possible quotation mark from end of second path.
+                               // Second path got split from first path.
+                               if (file2[file2.GetLength() - 1] == '\"')
+                                       file2.Delete(file2.GetLength() - 1, 1);
 
-                       // Set new paths to the structure
-                       if (pos > 0)
-                       {
+                               // Set new paths to the structure
                                m_cmdLineInfo.m_Files[0] = file1;
                                m_cmdLineInfo.m_Files.SetAtGrow(1, file2);
                                m_cmdLineInfo.m_nFiles = 2;