You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2011/08/24 18:01:18 UTC

svn commit: r1161180 - /subversion/branches/1.7.x-fs-verify/subversion/libsvn_fs_fs/fs_fs.c

Author: danielsh
Date: Wed Aug 24 16:01:18 2011
New Revision: 1161180

URL: http://svn.apache.org/viewvc?rev=1161180&view=rev
Log:
Follow-up to r1146708: only guard for NULL in the error paths.

* subversion/libsvn_fs_fs/fs_fs.c
  (representation_string): Add MAY_BE_CORRUPT parameter.
  (svn_fs_fs__write_noderev, create_rep_state): Update callers.

Modified:
    subversion/branches/1.7.x-fs-verify/subversion/libsvn_fs_fs/fs_fs.c

Modified: subversion/branches/1.7.x-fs-verify/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-fs-verify/subversion/libsvn_fs_fs/fs_fs.c?rev=1161180&r1=1161179&r2=1161180&view=diff
==============================================================================
--- subversion/branches/1.7.x-fs-verify/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/1.7.x-fs-verify/subversion/libsvn_fs_fs/fs_fs.c Wed Aug 24 16:01:18 2011
@@ -2434,18 +2434,20 @@ svn_fs_fs__get_node_revision(node_revisi
    that represents the location of representation REP.  If
    MUTABLE_REP_TRUNCATED is given, the rep is for props or dir contents,
    and only a "-1" revision number will be given for a mutable rep.
+   If MAY_BE_CORRUPT is true, guard for NULL when constructing the string.
    Perform the allocation from POOL.  */
 static const char *
 representation_string(representation_t *rep,
                       int format,
                       svn_boolean_t mutable_rep_truncated,
+                      svn_boolean_t may_be_corrupt,
                       apr_pool_t *pool)
 {
   if (rep->txn_id && mutable_rep_truncated)
     return "-1";
 
 #define DISPLAY_MAYBE_NULL_CHECKSUM(checksum)          \
-  ((checksum) != NULL                                  \
+  ((may_be_corrupt == FALSE || (checksum) != NULL)     \
    ? svn_checksum_to_cstring_display((checksum), pool) \
    : "(null)")
 
@@ -2498,12 +2500,13 @@ svn_fs_fs__write_noderev(svn_stream_t *o
                                                     format,
                                                     (noderev->kind
                                                      == svn_node_dir),
+                                                    FALSE,
                                                     pool)));
 
   if (noderev->prop_rep)
     SVN_ERR(svn_stream_printf(outfile, pool, HEADER_PROPS ": %s\n",
                               representation_string(noderev->prop_rep, format,
-                                                    TRUE, pool)));
+                                                    TRUE, FALSE, pool)));
 
   SVN_ERR(svn_stream_printf(outfile, pool, HEADER_CPATH ": %s\n",
                             noderev->created_path));
@@ -3139,7 +3142,7 @@ create_rep_state(struct rep_state **rep_
                                "Corrupt representation '%s'",
                                rep 
                                ? representation_string(rep, ffd->format, TRUE,
-                                                       pool)
+                                                       TRUE, pool)
                                : "(null)");
     }
   /* ### Call representation_string() ? */