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

Re: svn commit: r9697 - in trunk/subversion: clients/cmdline include libsvn_client libsvn_subr

From: Branko Čibej <brane_at_xbc.nu>
Date: 2004-05-14 03:04:10 CEST

Branko Čibej wrote:

> Greg Hudson wrote:
>
>> On Wed, 2004-05-12 at 18:57, brane@tigris.org wrote:
>>
>>
>>> + svn_error_t *err = SVN_NO_ERROR;
>>> + int i;
>>> +
>>> + for (i = 0; checklist[i].label != NULL; ++i)
>>> + {
>>> + const svn_version_t *lib_version = checklist[i].version_query();
>>> + if (!svn_ver_compatible (my_version, lib_version))
>>> + err = mismatch_error (checklist[i].label, lib_version, err);
>>> + }
>>> +
>>> + return err;
>>>
>>
>>
>> This could leak errors. Hardly a big deal in practice, but adding "&&
>> !err" to the loop condition, or a break to the body of the if statement,
>> would make the code more correct.
>>
>>
> No, it would make the code wrong IMHO because it would stop at the
> first incompatibility instead of listing them all.
>
> How about this: I remove the 'child' parameter from
> svn_ver_error_generator_t and set it explicitly in this loop, so that
> we don't rely on the mismatch_error implementation being correct.

That, or I change the mismatch_error type so that it only creates the
error string, and handle the error creation and chaining here. Even safer.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 14 03:04:49 2004

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.