aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-08-12 22:25:50 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-08-12 22:25:50 +0000
commit1b88990cbb84daa657d2eb62407bf1f9f24e6c69 (patch)
tree2c6421586929cdfaa1564c86740b8701a58b3d65 /lib
parentdf3e8e19c1fb49cfd7e54a958d963d718e3a5a3b (diff)
Fixed the LDAP_DEPRECATED #define as suggested by Daniel Johnson, and
indented some of the code to curl-style
Diffstat (limited to 'lib')
-rw-r--r--lib/ldap.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/ldap.c b/lib/ldap.c
index 1f29ac042..5908e11b6 100644
--- a/lib/ldap.c
+++ b/lib/ldap.c
@@ -46,7 +46,7 @@
#ifdef CURL_LDAP_WIN /* Use W$ LDAP implementation. */
# include <winldap.h>
#else
-#define LDAP_DEPRECATED /* Be sure ldap_init() is defined. */
+#define LDAP_DEPRECATED 1 /* Be sure ldap_init() is defined. */
# include <ldap.h>
#endif
@@ -376,9 +376,9 @@ static int _ldap_url_parse2 (const struct connectdata *conn, LDAPURLDesc *ludp)
if (!conn->data ||
!conn->data->reqdata.path ||
- conn->data->reqdata.path[0] != '/' ||
+ conn->data->reqdata.path[0] != '/' ||
!checkprefix(conn->protostr, conn->data->change.url))
- return LDAP_INVALID_SYNTAX;
+ return LDAP_INVALID_SYNTAX;
ludp->lud_scope = LDAP_SCOPE_BASE;
ludp->lud_port = conn->remote_port;
@@ -388,14 +388,14 @@ static int _ldap_url_parse2 (const struct connectdata *conn, LDAPURLDesc *ludp)
*/
ludp->lud_dn = strdup(conn->data->reqdata.path+1);
if (!ludp->lud_dn)
- return LDAP_NO_MEMORY;
+ return LDAP_NO_MEMORY;
p = strchr(ludp->lud_dn, '?');
LDAP_TRACE (("DN '%.*s'\n", p ? (size_t)(p-ludp->lud_dn) :
strlen(ludp->lud_dn), ludp->lud_dn));
if (!p)
- goto success;
+ goto success;
*p++ = '\0';
@@ -403,65 +403,65 @@ static int _ldap_url_parse2 (const struct connectdata *conn, LDAPURLDesc *ludp)
*/
q = strchr(p, '?');
if (q)
- *q++ = '\0';
+ *q++ = '\0';
if (*p && *p != '?') {
ludp->lud_attrs = split_str(p);
if (!ludp->lud_attrs)
- return LDAP_NO_MEMORY;
+ return LDAP_NO_MEMORY;
for (i = 0; ludp->lud_attrs[i]; i++)
- LDAP_TRACE (("attr[%d] '%s'\n", i, ludp->lud_attrs[i]));
+ LDAP_TRACE (("attr[%d] '%s'\n", i, ludp->lud_attrs[i]));
}
p = q;
if (!p)
- goto success;
+ goto success;
/* parse scope. skip "??"
*/
q = strchr(p, '?');
if (q)
- *q++ = '\0';
+ *q++ = '\0';
if (*p && *p != '?') {
ludp->lud_scope = str2scope(p);
if (ludp->lud_scope == -1)
- return LDAP_INVALID_SYNTAX;
+ return LDAP_INVALID_SYNTAX;
LDAP_TRACE (("scope %d\n", ludp->lud_scope));
}
p = q;
if (!p)
- goto success;
+ goto success;
/* parse filter
*/
q = strchr(p, '?');
if (q)
- *q++ = '\0';
+ *q++ = '\0';
if (!*p)
- return LDAP_INVALID_SYNTAX;
+ return LDAP_INVALID_SYNTAX;
ludp->lud_filter = p;
LDAP_TRACE (("filter '%s'\n", ludp->lud_filter));
p = q;
if (!p)
- goto success;
+ goto success;
/* parse extensions
*/
ludp->lud_exts = split_str(p);
if (!ludp->lud_exts)
- return LDAP_NO_MEMORY;
+ return LDAP_NO_MEMORY;
for (i = 0; ludp->lud_exts[i]; i++)
- LDAP_TRACE (("exts[%d] '%s'\n", i, ludp->lud_exts[i]));
+ LDAP_TRACE (("exts[%d] '%s'\n", i, ludp->lud_exts[i]));
-success:
+ success:
if (!unescape_elements(conn->data, ludp))
- return LDAP_NO_MEMORY;
+ return LDAP_NO_MEMORY;
return LDAP_SUCCESS;
}