$NetBSD$

--- src/mcpath.h.orig	2006-01-04 18:01:24.000000000 +0000
+++ src/mcpath.h
@@ -36,6 +36,7 @@ the Free Software Foundation, 675 Mass A
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <limits.h>
 
 #ifdef VMS
 #include <string.h>
@@ -93,7 +94,11 @@ struct mcpath_direntry
 #ifndef MSDOS
   int d_ino;
 #endif /* not MSDOS */
+#ifdef NAME_MAX
+  unsigned char d_name [MCPATH_BUFSIZ (NAME_MAX) + 1];
+#else
   unsigned char d_name [MCPATH_BUFSIZ (MAXNAMLEN) + 1];
+#endif
 };
 
 extern DIR *mc_opendir ();
