]> git.sur5r.net Git - openldap/blobdiff - libraries/liblutil/fetch.c
Fix TLS default for clients
[openldap] / libraries / liblutil / fetch.c
index 08ed885c02e315246e9ac6f2f132fd24c1f5a556..6535dd20b6ec6b4cb358ce8097779d5dcce4c04c 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2006 The OpenLDAP Foundation.
+ * Copyright 1999-2007 The OpenLDAP Foundation.
  * Portions Copyright 1999-2003 Kurt D. Zeilenga.
  * All rights reserved.
  *
@@ -43,23 +43,23 @@ ldif_open_url(
        LDAP_CONST char *urlstr )
 {
        FILE *url;
-       char *p = NULL;
 #ifdef HAVE_FETCH
        url = fetchGetURL( (char*) urlstr, "" );
 
 #else
        if( strncasecmp( "file:", urlstr, sizeof("file:")-1 ) == 0 ) {
-               p = urlstr + sizeof("file:")-1;
+               char *p;
+               urlstr += sizeof("file:")-1;
 
                /* we don't check for LDAP_DIRSEP since URLs should contain '/' */
-               if ( p[0] == '/' && p[1] == '/' ) {
-                       p += 2;
+               if ( urlstr[0] == '/' && urlstr[1] == '/' ) {
+                       urlstr += 2;
                        /* path must be absolute if authority is present */
-                       if ( p[0] != '/' )
+                       if ( urlstr[0] != '/' )
                                return NULL;
                }
 
-               p = ber_strdup( p );
+               p = ber_strdup( urlstr );
                ldap_pvt_hex_unescape( p );
 
                url = fopen( p, "rb" );