From 90ccb754fbeb0202c69b271cbbdc8fea7caaaa98 Mon Sep 17 00:00:00 2001 From: ts-korhonen Date: Wed, 21 Apr 2021 13:00:56 +0300 Subject: [PATCH] Fix MSVC builds: win_opendir.c defined unicode on itself while it's used not in unicode. --- src/win/win_opendir.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/win/win_opendir.c b/src/win/win_opendir.c index d7755e372..5339f0713 100644 --- a/src/win/win_opendir.c +++ b/src/win/win_opendir.c @@ -17,8 +17,6 @@ * Copyright 1998-2007 MicroWalt Corporation * Copyright 2017 Fred N. van Kempen */ -#define UNICODE -#include #include #include #include @@ -158,10 +156,11 @@ readdir(DIR *p) default: /* regular entry. */ #ifdef UNICODE wcsncpy(p->dent.d_name, ffp->name, MAXNAMLEN+1); + p->dent.d_reclen = (char)wcslen(p->dent.d_name); #else strncpy(p->dent.d_name, ffp->name, MAXNAMLEN+1); + p->dent.d_reclen = (char)strlen(p->dent.d_name); #endif - p->dent.d_reclen = (char) wcslen(p->dent.d_name); } /* Read next entry. */