apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: apr/tables apr_tables.c
Date Sat, 27 Jul 2002 22:59:20 GMT
brianp      2002/07/27 15:59:20

  Modified:    tables   apr_tables.c
  Log:
  Fixed a bug in apr_table_set/setn from an earlier change: entries
  at the end of the table weren't being properly shifted when apr_table_set/setn
  removed duplicate keys (found using "testtable" in apr/test)
  
  Revision  Changes    Path
  1.40      +4 -4      apr/tables/apr_tables.c
  
  Index: apr_tables.c
  ===================================================================
  RCS file: /home/cvs/apr/tables/apr_tables.c,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- apr_tables.c	27 Jul 2002 21:45:06 -0000	1.39
  +++ apr_tables.c	27 Jul 2002 22:59:20 -0000	1.40
  @@ -495,6 +495,7 @@
   {
       apr_table_entry_t *next_elt;
       apr_table_entry_t *end_elt;
  +    apr_table_entry_t *table_end;
       apr_uint32_t checksum;
       int hash;
   
  @@ -507,6 +508,7 @@
       }
       next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];;
       end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash];
  +    table_end =((apr_table_entry_t *) t->a.elts) + t->a.nelts;
   
       for (; next_elt <= end_elt; next_elt++) {
   	if ((checksum == next_elt->key_checksum) &&
  @@ -540,8 +542,6 @@
                * for the index)
                */
               if (dst_elt) {
  -                apr_table_entry_t *table_end =
  -                    ((apr_table_entry_t *) t->a.elts) + t->a.nelts;
                   for (; next_elt < table_end; next_elt++) {
                       *dst_elt++ = *next_elt;
                   }
  @@ -567,6 +567,7 @@
   {
       apr_table_entry_t *next_elt;
       apr_table_entry_t *end_elt;
  +    apr_table_entry_t *table_end;
       apr_uint32_t checksum;
       int hash;
   
  @@ -579,6 +580,7 @@
       }
       next_elt = ((apr_table_entry_t *) t->a.elts) + t->index_first[hash];;
       end_elt = ((apr_table_entry_t *) t->a.elts) + t->index_last[hash];
  +    table_end =((apr_table_entry_t *) t->a.elts) + t->a.nelts;
   
       for (; next_elt <= end_elt; next_elt++) {
   	if ((checksum == next_elt->key_checksum) &&
  @@ -612,8 +614,6 @@
                * for the index)
                */
               if (dst_elt) {
  -                apr_table_entry_t *table_end =
  -                    ((apr_table_entry_t *) t->a.elts) + t->a.nelts;
                   for (; next_elt < table_end; next_elt++) {
                       *dst_elt++ = *next_elt;
                   }
  
  
  

Mime
View raw message