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

[PATCH] Fix MacOS X dumper bug

From: William Uther <will+_at_cs.cmu.edu>
Date: 2002-07-26 20:48:12 CEST

Hi all,

  This is a bug fix (written and tested on the fs-convert-2490 branch) for
the Mac OS X dumper bug mentioned on the list.

  There were two problems. The obvious bug was that apr_off_t variables
were being printed using APR_SIZE_T_FMT. The less obvious bug was that
proplen was using apr_off_t when the prop string is stored in memory
(unnecessary), and also content_length was only apr_size_t when it needs to
hold both textlen and proplen. As textlen is (correctly) apr_off_t,
content_length needs to be apr_off_t too.

Later,

\x/ill :-}

   * dump.c (dump_node): Switched proplen to apr_size_t. Switched
            content_length to apr_off_t. Changed APR_SIZE_T_FMT to
            APR_OFF_T_FMT when printing textlen and content_length.

Index: ./subversion/libsvn_repos/dump.c
===================================================================
--- ./subversion/libsvn_repos/dump.c
+++ ./subversion/libsvn_repos/dump.c Fri Jul 26 14:21:41 2002
@@ -222,8 +222,8 @@
 {
   svn_stringbuf_t *propstring;
   apr_hash_t *prophash;
- apr_off_t textlen = 0, proplen = 0;
- apr_size_t content_length = 0, len;
+ apr_off_t textlen = 0, content_length = 0;
+ apr_size_t proplen = 0, len;
   svn_boolean_t must_dump_text = FALSE, must_dump_props = FALSE;
   const char *compare_path = path;
   svn_revnum_t compare_rev = eb->current_rev - 1;
@@ -407,7 +407,7 @@
       content_length += textlen;
       SVN_ERR (svn_stream_printf (eb->stream, pool,
                                   SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH
- ": %" APR_SIZE_T_FMT "\n", textlen));
+ ": %" APR_OFF_T_FMT "\n", textlen));
       /* ### someday write a node-content-checksum here. */
     }
 
@@ -417,7 +417,7 @@
      parsers. */
   SVN_ERR (svn_stream_printf (eb->stream, pool,
                               SVN_REPOS_DUMPFILE_CONTENT_LENGTH
- ": %" APR_SIZE_T_FMT "\n\n",
content_length));
+ ": %" APR_OFF_T_FMT "\n\n", content_length));
 
   /* Dump property content if we're supposed to do so. */
   if (must_dump_props)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jul 26 20:50:29 2002

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.