1 /* line64.c - routines for dealing with the slapd line format */
3 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <ac/stdlib.h>
13 #include <ac/string.h>
14 #include <ac/socket.h>
24 #include "ldap_config.h"
29 LDAP_CONST char *urlstr,
44 url = fetchGetURL( (char*) urlstr, "" );
47 if( strncasecmp( "file://", urlstr, sizeof("file://")-1 ) == 0 ) {
48 p = strchr( &urlstr[sizeof("file://")-1], '/' );
53 if( *p != *LDAP_DIRSEP ) {
54 /* skip over false root */
59 ldap_pvt_hex_unescape( p );
61 url = fopen( p, "r" );
74 while( (bytes = fread( buffer, 1, sizeof(buffer), url )) != 0 ) {
75 char *newp = ber_memrealloc( p, total + bytes );
82 SAFEMEMCPY( &p[total], buffer, bytes );