You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2019/01/28 15:18:55 UTC

svn commit: r1852379 - /subversion/trunk/subversion/libsvn_delta/path_driver.c

Author: julianfoad
Date: Mon Jan 28 15:18:55 2019
New Revision: 1852379

URL: http://svn.apache.org/viewvc?rev=1852379&view=rev
Log:
Fix a regression in the svn_delta_path_driver2().

Introduced in r1851738.

* subversion/libsvn_delta/path_driver.c
  (svn_delta_path_driver_step): Restore predictable behaviour for callbacks
    that don't set the 'dir baton' output parameter.

Modified:
    subversion/trunk/subversion/libsvn_delta/path_driver.c

Modified: subversion/trunk/subversion/libsvn_delta/path_driver.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/path_driver.c?rev=1852379&r1=1852378&r2=1852379&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/path_driver.c (original)
+++ subversion/trunk/subversion/libsvn_delta/path_driver.c Mon Jan 28 15:18:55 2019
@@ -228,7 +228,7 @@ svn_delta_path_driver_step(svn_delta_pat
   size_t common_len;
   apr_pool_t *subpool;
   dir_stack_t *item;
-  void *parent_db = NULL, *db = NULL;
+  void *parent_db, *db;
 
   /* If the first target path is not the root of the edit, we must first
      call open_root() ourselves. (If the first target path is the root of
@@ -310,6 +310,9 @@ svn_delta_path_driver_step(svn_delta_pat
       item = APR_ARRAY_IDX(state->db_stack, state->db_stack->nelts - 1, void *);
       parent_db = item->dir_baton;
     }
+  else
+    parent_db = NULL;
+  db = NULL;  /* predictable behaviour for callbacks that don't set it */
   subpool = svn_pool_create(state->pool);
   SVN_ERR(state->callback_func(&db, parent_db, state->callback_baton,
                                path, subpool));