]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/dn.c
Import nextid cleanup from devel.
[openldap] / servers / slapd / dn.c
index 226937efa99f521a9c0cf0d6ef98deeb631f7fe7..ec57f75ec7bd1342048d643c50932aa221cfb31a 100644 (file)
@@ -1,20 +1,16 @@
 /* dn.c - routines for dealing with distinguished names */
 
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
 #include "portable.h"
-#include "slap.h"
 
-static char    **dn_explode();
+#include <stdio.h>
+
+#include <ac/ctype.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
+#include "slap.h"
 
-#define DNSEPARATOR(c) (c == ',' || c == ';')
-#define SEPARATOR(c)   (c == ',' || c == ';' || c == '+')
-#define SPACE(c)       (c == ' ' || c == '\n')
-#define NEEDSESCAPE(c) (c == '\\' || c == '"')
 #define B4TYPE         0
 #define INTYPE         1
 #define B4EQUAL                2
@@ -179,7 +175,7 @@ dn_parent(
                if ( *(s + 1) == '\0' ) {
                        return( NULL );
                } else {
-                       return( strdup( s + 1 ) );
+                       return( ch_strdup( s + 1 ) );
                }
        }
 
@@ -202,11 +198,11 @@ dn_parent(
                        if ( *s == '"' )
                                inquote = 1;
                        else if ( DNSEPARATOR( *s ) )
-                               return( strdup( s + 1 ) );
+                               return( ch_strdup( s + 1 ) );
                }
        }
 
-       return( NULL );
+       return( ch_strdup("") );
 }
 
 /*
@@ -233,7 +229,7 @@ dn_issuffix(
                return( 0 );
        }
 
-       return( strcasecmp( dn + dnlen - suffixlen, suffix ) == 0 );
+       return( strcmp( dn + dnlen - suffixlen, suffix ) == 0 );
 }
 
 /*