From dacc0bfc7da20b4d0c669038a6289dc370098381 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 28 Dec 1998 00:44:15 +0000 Subject: [PATCH] Improve readability of base output in debugging. Also, output UNKNOWN_PREFIX ('?') instead of writing a nul character when the attribute prefix is unknown. --- servers/slapd/back-ldbm/back-ldbm.h | 2 ++ servers/slapd/back-ldbm/index.c | 6 +++--- servers/slapd/back-ldbm/search.c | 10 +++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/servers/slapd/back-ldbm/back-ldbm.h b/servers/slapd/back-ldbm/back-ldbm.h index 960d2e1d4e..c85df11367 100644 --- a/servers/slapd/back-ldbm/back-ldbm.h +++ b/servers/slapd/back-ldbm/back-ldbm.h @@ -29,6 +29,8 @@ LDAP_BEGIN_DECL #define SUB_PREFIX '*' /* prefix for substring keys */ #define CONT_PREFIX '\\' /* prefix for continuation keys */ +#define UNKNOWN_PREFIX '?' /* prefix for unknown keys */ + #define DEFAULT_BLOCKSIZE 8192 /* diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 4fe0f98871..819aa21bd4 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -129,7 +129,7 @@ index_read( realval = val; tmpval = NULL; - if ( prefix != '\0' ) { + if ( prefix != UNKNOWN_PREFIX ) { unsigned int len = strlen( val ); if ( (len + 2) < sizeof(buf) ) { @@ -185,7 +185,7 @@ add_value( realval = val; tmpval = NULL; idl = NULL; - if ( prefix != '\0' ) { + if ( prefix != UNKNOWN_PREFIX ) { unsigned int len = strlen( val ); if ( (len + 2) < sizeof(buf) ) { @@ -359,7 +359,7 @@ index2prefix( int indextype ) prefix = SUB_PREFIX; break; default: - prefix = '\0'; + prefix = UNKNOWN_PREFIX; break; } diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 0b488c0004..6ecf5b4abe 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -87,7 +87,7 @@ ldbm_back_search( (void) dn_normalize (realBase); - Debug( LDAP_DEBUG_TRACE, "using base %s\n", + Debug( LDAP_DEBUG_TRACE, "using base \"%s\"\n", realBase, 0, 0 ); switch ( scope ) { @@ -323,7 +323,7 @@ base_candidates( IDList *idl; Entry *e; - Debug(LDAP_DEBUG_TRACE, "base_candidates: base: %s\n", base, 0, 0); + Debug(LDAP_DEBUG_TRACE, "base_candidates: base: \"%s\"\n", base, 0, 0); *err = LDAP_SUCCESS; @@ -364,7 +364,7 @@ onelevel_candidates( char buf[20]; IDList *candidates; - Debug(LDAP_DEBUG_TRACE, "onelevel_candidates: base: %s\n", base, 0, 0); + Debug(LDAP_DEBUG_TRACE, "onelevel_candidates: base: \"%s\"\n", base, 0, 0); *err = LDAP_SUCCESS; e = NULL; @@ -425,8 +425,8 @@ subtree_candidates( Filter *f, **filterarg_ptr; IDList *candidates; - Debug(LDAP_DEBUG_TRACE, "subtree_candidates: base: %s\n", - base ? base : "NULL", 0, 0); + Debug(LDAP_DEBUG_TRACE, "subtree_candidates: base: \"%s\" %s\n", + base ? base : "NULL", lookupbase ? "lookupbase" : "", 0); /* * get the base object - unless we already have it (from one-level). -- 2.39.5