]> git.sur5r.net Git - openldap/commitdiff
allow file: URLs without authority spec.
authorHoward Chu <hyc@openldap.org>
Mon, 27 Nov 2006 18:59:46 +0000 (18:59 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 27 Nov 2006 18:59:46 +0000 (18:59 +0000)
libraries/liblutil/fetch.c

index 661bc1e75b164b45cc9be39466a2d942ca1a2fe8..3177744097b9b479c1819309b0968d4225be7d3c 100644 (file)
@@ -48,17 +48,12 @@ ldif_open_url(
        url = fetchGetURL( (char*) urlstr, "" );
 
 #else
-       if( strncasecmp( "file://", urlstr, sizeof("file://")-1 ) == 0 ) {
-               p = strchr( &urlstr[sizeof("file://")-1], '/' );
-               if( p == NULL ) {
-                       return NULL;
-               }
+       if( strncasecmp( "file:", urlstr, sizeof("file:")-1 ) == 0 ) {
+               p = urlstr + sizeof("file:")-1;
 
                /* we don't check for LDAP_DIRSEP since URLs should contain '/' */
-               if( p[1] == '.' && ( p[2] == '/' || ( p[2] == '.' && p[3] == '/' ))) {
-                       /* skip over false root */
-                       p++;
-               }
+               if ( p[0] == '/' && p[1] == '/' )
+                       p += 2;
 
                p = ber_strdup( p );
                ldap_pvt_hex_unescape( p );