You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/11/24 20:58:55 UTC
svn commit: r1038788 - in /subversion/trunk/subversion: include/svn_types.h
libsvn_subr/constructors.c
Author: danielsh
Date: Wed Nov 24 19:58:55 2010
New Revision: 1038788
URL: http://svn.apache.org/viewvc?rev=1038788&view=rev
Log:
Don't calloc() svn_tristate_t.
* subversion/include/svn_types.h
(svn_tristate_t): Add a warning.
* subversion/libsvn_subr/constructors.c
(svn_log_changed_path2_create): Initialize TEXT_MODIFIED and PROPS_MODIFIED.
Modified:
subversion/trunk/subversion/include/svn_types.h
subversion/trunk/subversion/libsvn_subr/constructors.c
Modified: subversion/trunk/subversion/include/svn_types.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_types.h?rev=1038788&r1=1038787&r2=1038788&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_types.h (original)
+++ subversion/trunk/subversion/include/svn_types.h Wed Nov 24 19:58:55 2010
@@ -185,6 +185,9 @@ svn_node_kind_from_word(const char *word
* that are just like booleans. The values have been set deliberately to
* make tristates disjoint from #svn_boolean_t.
*
+ * @note It is unsafe to use apr_pcalloc() to allocate these, since '0' is
+ * not a valid value.
+ *
* @since New in 1.7. */
typedef enum
{
Modified: subversion/trunk/subversion/libsvn_subr/constructors.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/constructors.c?rev=1038788&r1=1038787&r2=1038788&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/constructors.c (original)
+++ subversion/trunk/subversion/libsvn_subr/constructors.c Wed Nov 24 19:58:55 2010
@@ -67,6 +67,9 @@ svn_log_changed_path2_create(apr_pool_t
svn_log_changed_path2_t *new_changed_path
= apr_pcalloc(pool, sizeof(*new_changed_path));
+ new_changed_path->text_modified = svn_tristate_unknown;
+ new_changed_path->props_modified = svn_tristate_unknown;
+
return new_changed_path;
}