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

Re: checksum / compare_files question

From: John Szakmeister <john_at_szakmeister.net>
Date: Tue, 19 May 2009 04:32:13 -0400

On Mon, May 18, 2009 at 10:16 PM, Neels Janosch Hofmeyr <neels_at_elego.de> wrote:
> Hi all,
>
> I came across this snippet of code:
>
> subversion/libsvn_subr/checksum.c:
> [[[
> svn_boolean_t
> svn_checksum_match(const svn_checksum_t *checksum1,
>                   const svn_checksum_t *checksum2)
> {
>  if (checksum1 == NULL || checksum2 == NULL)
>    return TRUE;
> ]]]
>
> I don't see how that makes sense. If it does, then the function name is
> misleading. The comment from include/checksum.h is ... tricky:

It is a bit tricky, but the answer lies in svn_checksum_parse_hex().
If the checksum provided is all zeros (e.g., if the string read in
from node rep was '0000000000000000'), then svn_checksum_parse_hex()
will actually return NULL. IOW, NULL is the wildcard checksum even
though it's a string of zeros in the rep.

I'd say that better documentation of that fact is in order, although
I'm not sure where exactly that should be documented.

HTH!

-John

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2309057
Received on 2009-05-19 10:32:37 CEST

This is an archived mail posted to the Subversion Dev mailing list.