From e5a14187565ffb2b2ec750d6eb403e21738f46b5 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 4 Feb 2003 19:27:56 +0000 Subject: [PATCH] improve last commit --- libraries/libldap/ldap-int.h | 5 +++++ libraries/libldap/url.c | 8 +++++++- servers/slapd/back-meta/config.c | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h index ad517cfa7d..a769f287af 100644 --- a/libraries/libldap/ldap-int.h +++ b/libraries/libldap/ldap-int.h @@ -511,6 +511,11 @@ LDAP_F (int) ldap_url_parselist LDAP_P(( LDAPURLDesc **ludlist, const char *url )); +LDAP_F (int) ldap_url_parselist_ext LDAP_P(( + LDAPURLDesc **ludlist, + const char *url, + const char *sep )); + LDAP_F (int) ldap_url_parsehosts LDAP_P(( LDAPURLDesc **ludlist, const char *hosts, diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index 788a601f72..e5909bac41 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -880,6 +880,12 @@ ldap_url_duplist (LDAPURLDesc *ludlist) int ldap_url_parselist (LDAPURLDesc **ludlist, const char *url ) +{ + return ldap_url_parselist_ext( ludlist, url, ", " ); +} + +int +ldap_url_parselist_ext (LDAPURLDesc **ludlist, const char *url, const char *sep ) { int i, rc; LDAPURLDesc *ludp; @@ -890,7 +896,7 @@ ldap_url_parselist (LDAPURLDesc **ludlist, const char *url ) *ludlist = NULL; - urls = ldap_str2charray(url, ", "); + urls = ldap_str2charray(url, sep); if (urls == NULL) return LDAP_NO_MEMORY; diff --git a/servers/slapd/back-meta/config.c b/servers/slapd/back-meta/config.c index 80305f4aba..4477c2346d 100644 --- a/servers/slapd/back-meta/config.c +++ b/servers/slapd/back-meta/config.c @@ -157,7 +157,7 @@ meta_back_db_config( /* * uri MUST be legal! */ - if ( ldap_url_parselist( &ludp, argv[ 1 ] ) != LDAP_SUCCESS ) { + if ( ldap_url_parselist_ext( &ludp, argv[ 1 ], "\t" ) != LDAP_SUCCESS ) { fprintf( stderr, "%s: line %d: unable to parse URI" " in \"uri ://[:port]/\" line\n", -- 2.39.5