diff options
author | Brian Pane <brianp@apache.org> | 2003-06-24 06:56:40 +0000 |
---|---|---|
committer | Brian Pane <brianp@apache.org> | 2003-06-24 06:56:40 +0000 |
commit | 4e270159182ddcfca867f49f524a0e54301e3975 (patch) | |
tree | b65a2a93d4dab6406bc1a93aa4ab5466e8f3e4ff /tables | |
parent | 2fb5359ccdeb8d892b85e023b72636eae4e526b4 (diff) | |
download | apr-4e270159182ddcfca867f49f524a0e54301e3975.tar.gz |
fixed the removal of duplicate key values in apr_table_compress() where one key has more than two values
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64550 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tables')
-rw-r--r-- | tables/apr_tables.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 45e88172b..092bb3f68 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -1,3 +1,4 @@ +#include <stdio.h> /* ==================================================================== * The Apache Software License, Version 1.1 * @@ -1127,8 +1128,8 @@ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags) dups_found = 0; sort_next = sort_array; sort_end = sort_array + t->a.nelts; - last = sort_next; - while (++sort_next < sort_end) { + last = sort_next++; + while (sort_next < sort_end) { if (((*sort_next)->key_checksum == (*last)->key_checksum) && !strcasecmp((*sort_next)->key, (*last)->key)) { apr_table_entry_t **dup_last = sort_next + 1; @@ -1176,7 +1177,7 @@ APR_DECLARE(void) apr_table_compress(apr_table_t *t, unsigned flags) } while (++sort_next <= dup_last); } else { - last = sort_next; + last = sort_next++; } } |