subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bl...@apache.org
Subject svn commit: r1327711 - /subversion/trunk/subversion/libsvn_subr/checksum.c
Date Wed, 18 Apr 2012 22:35:03 GMT
Author: blair
Date: Wed Apr 18 22:35:02 2012
New Revision: 1327711

URL: http://svn.apache.org/viewvc?rev=1327711&view=rev
Log:
Reimplement svn_checksum_dup().

* subversion/libsvn_subr/checksum.c
  (svn_checksum_dup):
    Reimplement using checksum_create().

Modified:
    subversion/trunk/subversion/libsvn_subr/checksum.c

Modified: subversion/trunk/subversion/libsvn_subr/checksum.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/checksum.c?rev=1327711&r1=1327710&r2=1327711&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/checksum.c (original)
+++ subversion/trunk/subversion/libsvn_subr/checksum.c Wed Apr 18 22:35:02 2012
@@ -291,6 +291,9 @@ svn_checksum_t *
 svn_checksum_dup(const svn_checksum_t *checksum,
                  apr_pool_t *pool)
 {
+  svn_checksum_t *out;
+  apr_size_t digest_size;
+
   /* The duplicate of a NULL checksum is a NULL... */
   if (checksum == NULL)
     return NULL;
@@ -303,15 +306,19 @@ svn_checksum_dup(const svn_checksum_t *c
   switch (checksum->kind)
     {
       case svn_checksum_md5:
+        digest_size = APR_MD5_DIGESTSIZE;
         break;
       case svn_checksum_sha1:
+        digest_size = APR_SHA1_DIGESTSIZE;
         break;
       default:
         SVN_ERR_MALFUNCTION_NO_RETURN();
         break;
     }
 
-  return svn_checksum__from_digest(checksum->digest, checksum->kind, pool);
+  out = checksum_create(checksum->kind, digest_size, pool);
+  memcpy((unsigned char *)out->digest, checksum->digest, digest_size);
+  return out;
 }
 
 svn_error_t *



Mime
View raw message