$NetBSD: patch-aw,v 1.3 2013/08/31 14:45:43 joerg Exp $

--- src/unix.c.orig	2000-03-15 22:13:29.000000000 +0000
+++ src/unix.c
@@ -6,11 +6,14 @@
 
 #include <sys/types.h>
 #include <sys/param.h>
+#include <sys/ioctl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <pwd.h>
-#include <sys/dir.h>
+#include <dirent.h>
+#include <limits.h>
+#include <termios.h>
 #include <time.h>
 #include <unistd.h>
 #include "icb.h"
@@ -235,7 +238,11 @@ tildexpand (char *s)
 	struct passwd *pw;
 	char login[17];
 	char *p = login;
+#ifdef NAME_MAX
+	static char path[NAME_MAX + 1];
+#else
 	static char path[MAXNAMLEN+1];
+#endif
 
 	/* has to start with a tilde */
 	if (*s++ != '~')
