git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Debug: indent lookup operations
[exim.git]
/
src
/
src
/
lookups
/
dbmdb.c
diff --git
a/src/src/lookups/dbmdb.c
b/src/src/lookups/dbmdb.c
index 4e6ebad14c0bcdc9a562357ba7ac8b3e4980792e..bdc002d4e943e1e6d37934e906681eab40d31bad 100644
(file)
--- a/
src/src/lookups/dbmdb.c
+++ b/
src/src/lookups/dbmdb.c
@@
-2,7
+2,7
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 201
2
*/
+/* Copyright (c) University of Cambridge 1995 - 201
8
*/
/* See the file NOTICE for conditions of use and distribution. */
#include "../exim.h"
/* See the file NOTICE for conditions of use and distribution. */
#include "../exim.h"
@@
-18,8
+18,12
@@
static void *
dbmdb_open(uschar *filename, uschar **errmsg)
{
static void *
dbmdb_open(uschar *filename, uschar **errmsg)
{
+uschar * dirname = string_copy(filename);
+uschar * s;
EXIM_DB *yield = NULL;
EXIM_DB *yield = NULL;
-EXIM_DBOPEN(filename, O_RDONLY, 0, &yield);
+
+if ((s = Ustrrchr(dirname, '/'))) *s = '\0';
+EXIM_DBOPEN(filename, dirname, O_RDONLY, 0, &yield);
if (yield == NULL)
{
int save_errno = errno;
if (yield == NULL)
{
int save_errno = errno;
@@
-87,7
+91,7
@@
the keylength in order to include the terminating zero. */
static int
dbmdb_find(void *handle, uschar *filename, const uschar *keystring, int length,
static int
dbmdb_find(void *handle, uschar *filename, const uschar *keystring, int length,
- uschar **result, uschar **errmsg,
BOOL
*do_cache)
+ uschar **result, uschar **errmsg,
uint
*do_cache)
{
EXIM_DB *d = (EXIM_DB *)handle;
EXIM_DATUM key, data;
{
EXIM_DB *d = (EXIM_DB *)handle;
EXIM_DATUM key, data;
@@
-120,7
+124,7
@@
return FAIL;
int
static dbmnz_find(void *handle, uschar *filename, const uschar *keystring, int length,
int
static dbmnz_find(void *handle, uschar *filename, const uschar *keystring, int length,
- uschar **result, uschar **errmsg,
BOOL
*do_cache)
+ uschar **result, uschar **errmsg,
uint
*do_cache)
{
return dbmdb_find(handle, filename, keystring, length-1, result, errmsg,
do_cache);
{
return dbmdb_find(handle, filename, keystring, length-1, result, errmsg,
do_cache);
@@
-140,7
+144,7
@@
return dbmdb_find(handle, filename, keystring, length-1, result, errmsg,
static int
dbmjz_find(void *handle, uschar *filename, const uschar *keystring, int length,
static int
dbmjz_find(void *handle, uschar *filename, const uschar *keystring, int length,
- uschar **result, uschar **errmsg,
BOOL
*do_cache)
+ uschar **result, uschar **errmsg,
uint
*do_cache)
{
uschar *key_item, *key_buffer, *key_p;
const uschar *key_elems = keystring;
{
uschar *key_item, *key_buffer, *key_p;
const uschar *key_elems = keystring;
@@
-195,7
+199,7
@@
if (key_p == key_buffer)
empty element to put one in. Boundary: key length 1, is a NULL */
key_item_len = key_p - key_buffer - 1;
empty element to put one in. Boundary: key length 1, is a NULL */
key_item_len = key_p - key_buffer - 1;
-DEBUG(D_lookup) debug_printf("NUL-joined key length: %d\n", key_item_len);
+DEBUG(D_lookup) debug_printf
_indent
("NUL-joined key length: %d\n", key_item_len);
/* beware that dbmdb_find() adds 1 to length to get back terminating NUL, so
because we've calculated the real length, we need to subtract one more here */
/* beware that dbmdb_find() adds 1 to length to get back terminating NUL, so
because we've calculated the real length, we need to subtract one more here */