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

Re: svn commit: r9716 - trunk/subversion/libsvn_wc

From: Ben Reser <ben_at_reser.org>
Date: 2004-05-15 18:31:05 CEST

On Fri, May 14, 2004 at 05:14:19PM -0500, bliss@tigris.org wrote:
> Author: bliss
> Date: Fri May 14 17:14:14 2004
> New Revision: 9716
>
> Modified:
> trunk/subversion/libsvn_wc/adm_crawler.c
> Log:
> Fix issue #1854 (user data loss on case-insensitive file systems)
>
> * subversion/libsvn_wc/adm_crawler.c
> (report_revisions): Call svn_io_check_path for entries that appear
> to be missing to be sure that they are really missing.
>
>
> Modified: trunk/subversion/libsvn_wc/adm_crawler.c
> ==============================================================================
> --- trunk/subversion/libsvn_wc/adm_crawler.c (original)
> +++ trunk/subversion/libsvn_wc/adm_crawler.c Fri May 14 17:14:14 2004
> @@ -214,7 +214,7 @@
> apr_ssize_t klen;
> void *val;
> const svn_wc_entry_t *current_entry;
> - svn_node_kind_t *dirent_kind;
> + svn_node_kind_t *dirent_kind, dirent_kind_storage;
> svn_boolean_t missing = FALSE;
>
> /* Clear the iteration subpool here because the loop has a bunch
> @@ -250,7 +250,17 @@
> /* Is the entry on disk? Set a flag if not. */
> dirent_kind = (svn_node_kind_t *) apr_hash_get (dirents, key, klen);
> if (! dirent_kind)
> - missing = TRUE;
> + {
> + /* It is possible on a case insensitive system that the
> + entry is not really missing, so we call our trusty but
> + expensive friend svn_io_check_path to be sure. */
> + SVN_ERR (svn_io_check_path (this_full_path, &dirent_kind_storage,
> + iterpool));
> + if (dirent_kind_storage == svn_node_none)
> + missing = TRUE;
> + else
> + dirent_kind = &dirent_kind_storage;
> + }

Wouldn't it be (marginally) better to put the dirent_kind_storage within
the if block? There's not really any point in allocating the memory
outside the block if we're not using it. :)

-- 
Ben Reser <ben@reser.org>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat May 15 18:31:27 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.