blob: 2ccfa679bb6299881e386161ea4999868d6df4c0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
$NetBSD: patch-ab,v 1.6 2011/12/05 22:49:47 joerg Exp $
--- src/mail/addrbookdb.cpp.orig 2004-01-02 03:54:01.000000000 +0000
+++ src/mail/addrbookdb.cpp
@@ -33,6 +33,8 @@ using namespace std;
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
+#include <limits.h>
+#include <string.h>
#include "config.h"
#if HAVE_DIRENT_H
@@ -174,7 +176,11 @@ AddressBookDB::Load(const char *configdi
dir = opendir(configdir);
if (dir == NULL)
return false;
+#ifdef HAVE_READDIR_R
while (readdir_r(dir, &entry, &result) == 0 && result != NULL) {
+#else
+ while ( (result = readdir(dir)) != NULL) {
+#endif
if (NAMLEN(result) > 8 && strncmp(result->d_name, ".xfbook.", 8) == 0) {
strncpy(buf, result->d_name, NAMLEN(result));
buf[NAMLEN(result)] = '\0';
|