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

Re: svn commit: r12262 - in branches/locking/subversion: libsvn_fs_fs tests/libsvn_fs

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2004-12-09 21:59:32 CET

"Brian W. Fitzpatrick" <fitz@collab.net> writes:

> On Dec 9, 2004, at 12:29 PM, Philip Martin wrote:
>> fitz@tigris.org writes:
>>> +
>>> + /* Skip directories. */
>>> + if (finfo->filetype == APR_DIR)
>>> + return SVN_NO_ERROR;
>>> +
>>> + /* Get the repository-relative path for the lock. */
>>> + SVN_ERR (base_path_to_lock_file (&base_path, dir_baton->fs, pool));
>>> + rel_path = path + strlen(base_path);
>> That looks just a little fragile. It probably works, but base_path is
>> constructed using apr_filepath_merge while svn_io_dir_walk uses the
>> svn_path functions, will they always be consistent?
> Hmmm. Any suggestions? I initially used svn_path_join_many, but
> shied away since the docstring said to only use it for "internal"
> canonicalized paths.

My first concern was how do I know that rel_path points into path and
not into arbitrary memory beyond the null. It was while attempting to
determine the algorithm that relates path and base_path that I
realised they use different libraries. I suppose you could use
strncmp to verify that base_path matches the start of path.

Philip Martin
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Dec 10 04:15:12 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.