From e7be7301c20b8232c03574bc07ff255246d3a34f Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 27 Nov 2006 18:59:46 +0000 Subject: [PATCH] allow file: URLs without authority spec. --- libraries/liblutil/fetch.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libraries/liblutil/fetch.c b/libraries/liblutil/fetch.c index 661bc1e75b..3177744097 100644 --- a/libraries/liblutil/fetch.c +++ b/libraries/liblutil/fetch.c @@ -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 ); -- 2.39.5