]> git.sur5r.net Git - openldap/commitdiff
Changed AttributeName back into an array instead of a linked list
authorHoward Chu <hyc@openldap.org>
Thu, 3 Jan 2002 05:41:50 +0000 (05:41 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 3 Jan 2002 05:41:50 +0000 (05:41 +0000)
servers/slapd/back-perl/search.c
servers/slapd/back-sql/search.c
servers/slapd/back-tcl/tcl_search.c

index e3b5928aae90aaa4595b2228ad91e5c7de3cc64d..1e71424d67163051af324aee20dc263a521667ee 100644 (file)
@@ -66,7 +66,7 @@ perl_back_search(
                XPUSHs(sv_2mortal(newSViv( timelimit )));
                XPUSHs(sv_2mortal(newSViv( attrsonly )));
 
-               for ( an = attrs; an; an = an->an_next ) {
+               for ( an = attrs; an && an->an_name.bv_val; an++ ) {
                        XPUSHs(sv_2mortal(newSVpv( an->an_name.bv_val , 0)));
                }
                PUTBACK;
index e3edcd036aaec18fd732fe36552a441513d7614f..cf68f8c1289acdc08c82a8f23f9f18fb2342ecc7 100644 (file)
@@ -62,7 +62,7 @@ void backsql_init_search(backsql_srch_info *bsi,backsql_info *bi,char *nbase,int
  {
   bsi->attrs=(char**)ch_calloc(1,sizeof(char*));
   bsi->attrs[0]=NULL;
-  for(p=attrs;p!=NULL;p=p->an_next)
+  for(p=attrs;p->an_name.bv_val;p++)
    backsql_attrlist_add(bsi,p->an_name.bv_val);
  }
  else
index f807dba16f6ef34b83655d46f1bc695137c5e601..0764900d85a4e8043dcaf5a7630e6eb139b97edf 100644 (file)
@@ -46,10 +46,10 @@ tcl_back_search (
                return (-1);
        }
 
-       for (i = 0, an = attrs; an != NULL; an=an->an_next, i++);
+       for (i = 0, an = attrs; an && an->an_name.bv_val; an++, i++);
        if (i > 0) {
                sattrs = ch_malloc( (i+1) * sizeof(char *));
-               for (i = 0, an = attrs; an; an=an->an_next, i++)
+               for (i = 0, an = attrs; an->an_name.bv_val; an++, i++)
                        sattrs[i] = an->an_name.bv_val;
                sattrs[i] = NULL;
                attrs_tcl = Tcl_Merge (i, sattrs);