You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by fa...@locus.apache.org on 2000/05/09 20:56:20 UTC

cvs commit: apache-2.0/src/lib/apr/lib apr_hash.c

fanf        00/05/09 11:56:14

  Modified:    src/lib/apr/include apr_hash.h
               src/lib/apr/lib apr_hash.c
  Log:
  Make the hash API nicer when dealing with nul-terminated strings.
  
  Revision  Changes    Path
  1.2       +2 -0      apache-2.0/src/lib/apr/include/apr_hash.h
  
  Index: apr_hash.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_hash.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- apr_hash.h	2000/05/03 17:24:44	1.1
  +++ apr_hash.h	2000/05/09 18:56:10	1.2
  @@ -92,6 +92,7 @@
       arg 1) The hash table
       arg 2) Pointer to the key
       arg 3) Length of the key
  +           If the length is 0 it is assumed to be strlen(key)+1
       arg 4) Value to associate with the key
   
   If the value is NULL the hash entry is deleted.
  @@ -109,6 +110,7 @@
       arg 1) The hash table
       arg 2) Pointer to the key
       arg 3) Length of the key
  +           If the length is 0 it is assumed to be strlen(key)+1
   
   Returns NULL if the key is not present.
   
  
  
  
  1.2       +3 -0      apache-2.0/src/lib/apr/lib/apr_hash.c
  
  Index: apr_hash.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/lib/apr_hash.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- apr_hash.c	2000/05/03 17:24:42	1.1
  +++ apr_hash.c	2000/05/09 18:56:12	1.2
  @@ -215,6 +215,9 @@
       int hash;
       int i;
   
  +    if (klen == 0)
  +	klen = strlen(key) + 1;
  +
       /*
        * This hash function is used by perl 5; RSE attributes it to DJB.
        * (See Message-ID: <19...@engelschall.com>