[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH]Fix Segfault while detecting the implicit merge source

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2007-05-15 06:24:26 CEST

Hi All,
Currently 'svn merge' from a WC which has no copy_source segfaults.

The attached patch fixes it.

With regards
Kamesh Jayachandran

[[[
Fix segfault on svn merge source detection.

* subversion/libsvn_client/log.c
  (svn_client__suggest_merge_sources):
   Don't assume copy source to exist always.

Patch by: kameshj
]]]

Index: subversion/libsvn_client/log.c
===================================================================
--- subversion/libsvn_client/log.c (revision 25012)
+++ subversion/libsvn_client/log.c (working copy)
@@ -233,7 +233,8 @@
   /* ### TODO: Use RA APIs directly to improve efficiency. */
   SVN_ERR(svn_client__get_copy_source(path_or_url, revision, &copyfrom_path,
                                       &copyfrom_rev, ctx, pool));
- APR_ARRAY_PUSH(*suggestions, const char *) = copyfrom_path;
+ if (copyfrom_path)
+ APR_ARRAY_PUSH(*suggestions, const char *) = copyfrom_path;
 
   SVN_ERR(svn_client_get_mergeinfo(&mergeinfo, path_or_url, revision,
                                    ctx, pool));
@@ -241,7 +242,7 @@
     {
       const char *path;
       apr_hash_this(hi, (void *) &path, NULL, NULL);
- if (strcmp(path, copyfrom_path) != 0)
+ if (copyfrom_path && strcmp(path, copyfrom_path) != 0)
         {
           APR_ARRAY_PUSH(*suggestions, const char *) = apr_pstrdup(pool, path);
         }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 15 06:24:46 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.