You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2012/02/12 18:42:50 UTC

svn commit: r1243284 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Author: stefan2
Date: Sun Feb 12 17:42:50 2012
New Revision: 1243284

URL: http://svn.apache.org/viewvc?rev=1243284&view=rev
Log:
Ensure that failures to construct a window key will result
in defined cache access behavior. We use the latest cache
API improvements to skip cache access in that case.

* subversion/libsvn_fs_fs/fs_fs.c
  (get_window_key): return NULL instead of "" upon failure

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1243284&r1=1243283&r2=1243284&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Sun Feb 12 17:42:50 2012
@@ -2941,7 +2941,8 @@ struct rep_read_baton
 };
 
 /* Combine the name of the rev file in RS with the given OFFSET to form
- * a cache lookup key. Allocations will be made from POOL. */
+ * a cache lookup key.  Allocations will be made from POOL.  May return
+ * NULL if the key cannot be constructed. */
 static const char*
 get_window_key(struct rep_state *rs, apr_off_t offset, apr_pool_t *pool)
 {
@@ -2955,7 +2956,7 @@ get_window_key(struct rep_state *rs, apr
    * comparison _will_ find them.
    */
   if (apr_file_name_get(&name, rs->file))
-    return "";
+    return NULL;
 
   /* Handle packed files as well by scanning backwards until we find the
    * revision or pack number. */