subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dan...@apache.org
Subject svn commit: r965778 - /subversion/trunk/subversion/libsvn_client/patch.c
Date Tue, 20 Jul 2010 09:54:27 GMT
Author: dannas
Date: Tue Jul 20 09:54:27 2010
New Revision: 965778

URL: http://svn.apache.org/viewvc?rev=965778&view=rev
Log:
Clarify what fields are initialized to zero to avoid ambiguity.

* subversion/libsvn_client/patch.c
  (init_patch_target): Clarify doc comment and rearrange lines to
    make it clearer that both 'target' and 'content_info' are allocated
    with apr_pcalloc() and thus have all fields set to zero by default.

Modified:
    subversion/trunk/subversion/libsvn_client/patch.c

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=965778&r1=965777&r2=965778&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Tue Jul 20 09:54:27 2010
@@ -428,9 +428,9 @@ init_patch_target(patch_target_t **patch
   patch_target_t *target;
   target_content_info_t *content_info; 
 
-  target = apr_pcalloc(result_pool, sizeof(*target));
   content_info = apr_pcalloc(result_pool, sizeof(*content_info));
 
+  /* All other fields in content_info are FALSE or NULL due to apr_pcalloc().*/
   content_info->current_line = 1;
   content_info->eol_style = svn_subst_eol_style_none;
   content_info->lines = apr_array_make(result_pool, 0,
@@ -439,12 +439,13 @@ init_patch_target(patch_target_t **patch
   content_info->keywords = apr_hash_make(result_pool);
   content_info->pool = result_pool;
 
-  target->content_info = content_info;
+  target = apr_pcalloc(result_pool, sizeof(*target));
 
-  /* All other fields are FALSE or NULL due to apr_pcalloc(). */
+  /* All other fields in target are FALSE or NULL due to apr_pcalloc(). */
   target->patch = patch;
   target->db_kind = svn_node_none;
   target->kind_on_disk = svn_node_none;
+  target->content_info = content_info;
   target->pool = result_pool;
 
   SVN_ERR(resolve_target_path(target, patch->new_filename,



Mime
View raw message