Commit 0ecaa025 authored by Ondřej Kuzník's avatar Ondřej Kuzník Committed by Quanah Gibson-Mount
Browse files

ITS#9764 slapo-valsort: Maintain values in order of insertion

parent 52bba704
...@@ -88,7 +88,7 @@ static Syntax *syn_numericString; ...@@ -88,7 +88,7 @@ static Syntax *syn_numericString;
static int static int
valsort_cf_func(ConfigArgs *c) { valsort_cf_func(ConfigArgs *c) {
slap_overinst *on = (slap_overinst *)c->bi; slap_overinst *on = (slap_overinst *)c->bi;
valsort_info vitmp, *vi; valsort_info vitmp, *vi, **vip;
const char *text = NULL; const char *text = NULL;
int i, is_numeric; int i, is_numeric;
struct berval bv = BER_BVNULL; struct berval bv = BER_BVNULL;
...@@ -200,10 +200,14 @@ valsort_cf_func(ConfigArgs *c) { ...@@ -200,10 +200,14 @@ valsort_cf_func(ConfigArgs *c) {
c->log, c->cr_msg, c->argv[1] ); c->log, c->cr_msg, c->argv[1] );
return(1); return(1);
} }
for ( vip = &on->on_bi.bi_private; *vip; vip = &(*vip)->vi_next )
/* Get to the end */ ;
vi = ch_malloc( sizeof(valsort_info) ); vi = ch_malloc( sizeof(valsort_info) );
*vi = vitmp; *vi = vitmp;
vi->vi_next = on->on_bi.bi_private; vi->vi_next = *vip;
on->on_bi.bi_private = vi; *vip = vi;
return 0; return 0;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment