I (Julian Foad) wrote: > Why doesn't this patch work as I expect? [...]
OK I've found the problem. It's these lines in do_directory_merge(): svn_merge_range_t *first_target_range = APR_ARRAY_IDX( target_merge_path->remaining_ranges, 0, svn_merge_range_t *); if (first_target_range && ...) It's not valid to assume that element 0 will read as a null pointer when the array is empty. That happened to be the case, but when I change the delete-an-element code to use svn_sort__array_delete(), that is no longer the case. Easy to fix. I should be able to complete and commit the patch now. The patch will replace in-line code with a call to svn_sort__array_delete() or svn_sort__array_insert() or apr_array_cat() in a few places, not just the one place that I showed in this thread. - Julian