From aa2c1c47cd2c695bf971d76c1966e50b3e61bfa1 Mon Sep 17 00:00:00 2001 From: Jiapeng Li Date: Sun, 8 Dec 2013 14:17:39 +0100 Subject: [PATCH] Config: bring configuration feature to Windows --- libnfc/conf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libnfc/conf.c b/libnfc/conf.c index 7bda47d..bf68def 100644 --- a/libnfc/conf.c +++ b/libnfc/conf.c @@ -177,10 +177,14 @@ conf_devices_load(const char *dirname, nfc_context *context) log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "Unable to open directory: %s", dirname); } else { struct dirent *de; + #ifdef WIN32 + while ((de = readdir(d)) != NULL ) { + #else struct dirent entry; struct dirent *result; while ((readdir_r(d, &entry, &result) == 0) && (result != NULL)) { de = &entry; + #endif if (de->d_name[0] != '.') { const size_t filename_len = strlen(de->d_name); const size_t extension_len = strlen(".conf");