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

Re: bug in libsvn_wc/questions.c

From: Peter Lundblad <plundblad_at_google.com>
Date: 2007-04-04 14:23:31 CEST

Stefan Küng writes:
> Hi,
>
> There's a problem in the function
> svn_wc__text_modified_internal_p() right at the beginning:
>
> /* No matter which way you look at it, the file needs to exist. */
> err = svn_io_stat(&finfo, filename,
> APR_FINFO_SIZE | APR_FINFO_MTIME | APR_FINFO_TYPE
> | APR_FINFO_LINK, pool);
> if ((err && APR_STATUS_IS_ENOENT(err->apr_err))
> || !(finfo.filetype & (APR_REG | APR_LNK)))
> {
>

Thanks, Stefan! ...and the person who fixes this could also make sure it
doesn't give a bogus result if err is set but with another error code.

> The if clause checks for an error and the wrong filetype. The problem
> is that finfo.filetype is an apr_filetype_e enum, but it's treated
> like a bitmask in the check.
>
> I think the correct way to check this would be something like this:
>
> if ((err && APR_STATUS_IS_ENOENT(err->apr_err))
> || ((finfo.filetype != APR_REG) && (finfo.filetype != APR_LNK)))
            ^ ! err &&

Thanks,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Apr 4 14:24:07 2007

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.