Diff
Not logged in

Differences From:

File src/merge3.c part of check-in [3e89b0c526] - Fix a bug in error recovery logic in the 3-way merge. Added new comments to the 3-way merge code to hopefully make it easier to understand. by drh on 2009-03-22 12:25:59. [view]

To:

File src/merge3.c part of check-in [8e147fdbac] - Fix a segfault that occurs on an attempt to merge binary files. Ticket 3f2cb270b2f6. by drh on 2009-12-19 03:16:52. Also file src/merge3.c part of check-in [76bc05d739] - merge with trunk by btheado on 2009-12-30 20:33:59. [view]

@@ -162,8 +162,10 @@
   static const char zBegin[] = ">>>>>>> BEGIN MERGE CONFLICT\n";
   static const char zMid[]   = "============================\n";
   static const char zEnd[]   = "<<<<<<< END MERGE CONFLICT\n";
 
+  blob_zero(pOut);         /* Merge results stored in pOut */
+
   /* Compute the edits that occur from pPivot => pV1 (into aC1)
   ** and pPivot => pV2 (into aC2).  Each of the aC1 and aC2 arrays is
   ** an array of integer triples.  Within each triple, the first integer
   ** is the number of lines of text to copy directly from the pivot,
@@ -178,9 +180,8 @@
     free(aC2);
     return -1;
   }
 
-  blob_zero(pOut);         /* Merge results stored in pOut */
   blob_rewind(pV1);        /* Rewind inputs:  Needed to reconstruct output */
   blob_rewind(pV2);
   blob_rewind(pPivot);