From a5f36457bfe34199513f30330eaf9eb67ae88c57 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Mon, 16 Oct 2000 02:58:15 +0000 Subject: [PATCH] the zero-length hash key is valid. use (-1) as the discrimnator for auto-computed string-length hash keys git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86604 13f79535-47bb-0310-9956-ffa450edef68 --- modules/dav/main/liveprop.c | 7 ++++--- modules/dav/main/providers.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/dav/main/liveprop.c b/modules/dav/main/liveprop.c index 5e083b7061..7388536dbe 100644 --- a/modules/dav/main/liveprop.c +++ b/modules/dav/main/liveprop.c @@ -87,19 +87,20 @@ DAV_DECLARE(void) dav_register_liveprop_namespace(apr_pool_t *p, apr_register_cleanup(p, NULL, dav_cleanup_liveprops, apr_null_cleanup); } - value = (int)apr_hash_get(dav_liveprop_uris, uri, 0); + value = (int)apr_hash_get(dav_liveprop_uris, uri, APR_HASH_KEY_STRING); if (value != 0) { /* already registered */ return; } /* start at 1, and count up */ - apr_hash_set(dav_liveprop_uris, uri, 0, (void *)++dav_liveprop_count); + apr_hash_set(dav_liveprop_uris, uri, APR_HASH_KEY_STRING, + (void *)++dav_liveprop_count); } DAV_DECLARE(int) dav_get_liveprop_ns_index(const char *uri) { - return (int)apr_hash_get(dav_liveprop_uris, uri, 0); + return (int)apr_hash_get(dav_liveprop_uris, uri, APR_HASH_KEY_STRING); } int dav_get_liveprop_ns_count(void) diff --git a/modules/dav/main/providers.c b/modules/dav/main/providers.c index 2fa704e51d..1a534514df 100644 --- a/modules/dav/main/providers.c +++ b/modules/dav/main/providers.c @@ -70,7 +70,7 @@ static apr_status_t dav_cleanup_providers(void *ctx) } DAV_DECLARE(void) dav_register_provider(apr_pool_t *p, const char *name, - const dav_provider *provider) + const dav_provider *provider) { /* ### ignore the pool; it is NULL right now */ p = ap_global_hook_pool; @@ -81,10 +81,10 @@ DAV_DECLARE(void) dav_register_provider(apr_pool_t *p, const char *name, } /* just set it. no biggy if it was there before. */ - apr_hash_set(dav_repos_providers, name, 0, provider); + apr_hash_set(dav_repos_providers, name, APR_HASH_KEY_STRING, provider); } const dav_provider * dav_lookup_provider(const char *name) { - return apr_hash_get(dav_repos_providers, name, 0); + return apr_hash_get(dav_repos_providers, name, APR_HASH_KEY_STRING); } -- 2.50.1