1 /* line64.c - routines for dealing with the slapd line format */
4 * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12 #include <ac/stdlib.h>
14 #include <ac/string.h>
15 #include <ac/socket.h>
25 #include "ldap_config.h"
30 LDAP_CONST char *urlstr,
45 url = fetchGetURL( (char*) urlstr, "" );
48 if( strncasecmp( "file://", urlstr, sizeof("file://")-1 ) == 0 ) {
49 p = strchr( &urlstr[sizeof("file://")-1], '/' );
54 if( *p != *LDAP_DIRSEP ) {
55 /* skip over false root */
60 ldap_pvt_hex_unescape( p );
62 url = fopen( p, "rb" );
75 while( (bytes = fread( buffer, 1, sizeof(buffer), url )) != 0 ) {
76 char *newp = ber_memrealloc( p, total + bytes );
83 AC_MEMCPY( &p[total], buffer, bytes );