From 923bea9e1497192e8891143abf8fb6560115a801 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 12 May 2005 03:24:49 +0000 Subject: [PATCH] Fix attribute sorting --- servers/slapd/entry.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index ffef157940..e83ed0000d 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -181,24 +181,23 @@ str2entry2( char *s, int checkvals ) int fv; for (i=0; ik; l-- ) { - type[l] = type[l-1]; - vals[l] = vals[l-1]; - freeval[l] = freeval[l-1]; + for ( k=j; k>i; k-- ) { + type[k] = type[k-1]; + vals[k] = vals[k-1]; + freeval[k] = freeval[k-1]; } - type[l] = type[i]; - vals[l] = bv; - freeval[l] = fv; + k++; + type[k] = type[i]; + vals[k] = bv; + freeval[k] = fv; } - i = k = j; + i++; } } } -- 2.39.5