mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 16:19:35 -05:00
ITS#8273 Windows file:// URL fixup
This commit is contained in:
parent
b6974ccd9f
commit
28a02271f0
1 changed files with 15 additions and 2 deletions
|
|
@ -50,9 +50,22 @@ ldif_open_url(
|
||||||
/* we don't check for LDAP_DIRSEP since URLs should contain '/' */
|
/* we don't check for LDAP_DIRSEP since URLs should contain '/' */
|
||||||
if ( urlstr[0] == '/' && urlstr[1] == '/' ) {
|
if ( urlstr[0] == '/' && urlstr[1] == '/' ) {
|
||||||
urlstr += 2;
|
urlstr += 2;
|
||||||
/* path must be absolute if authority is present */
|
/* path must be absolute if authority is present
|
||||||
if ( urlstr[0] != '/' )
|
* technically, file://hostname/path is also legal but we don't
|
||||||
|
* accept a non-empty hostname
|
||||||
|
*/
|
||||||
|
if ( urlstr[0] != '/' ) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
/* An absolute path in improper file://C:/foo/bar format */
|
||||||
|
if ( urlstr[1] != ':' )
|
||||||
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
#ifdef _WIN32
|
||||||
|
/* An absolute path in proper file:///C:/foo/bar format */
|
||||||
|
if ( urlstr[2] == ':' )
|
||||||
|
urlstr++;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
p = ber_strdup( urlstr );
|
p = ber_strdup( urlstr );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue