$NetBSD: patch-ab,v 1.4 2003/12/06 16:10:48 tron Exp $ --- wmbiff/wmbiff.c.orig Sun Nov 9 00:43:50 2003 +++ wmbiff/wmbiff.c Sat Dec 6 17:04:32 2003 @@ -25,6 +25,14 @@ #include #include +#if defined(FreeBSD) || defined(__NetBSD__) || defined(__OpenBSD__) +#include +#endif + +#ifndef _PATH_MAILDIR +#define _PATH_MAILDIR "/var/mail" +#endif + #include "../wmgeneral/wmgeneral.h" #include "../wmgeneral/misc.h" @@ -370,7 +378,7 @@ " Message: %s\n" " libgcrypt version: %s\n" " recovering: will fail later if using CRAM-MD5 or APOP authentication.\n", - zok, gcry_strerror(gcry_errno()), gcry_check_version(NULL)); + zok, gcry_strerror(zok), gcry_check_version(NULL)); }; #endif @@ -384,8 +392,8 @@ strcpy(mbox[0].path, m); } else if ((m = getenv("USER")) != NULL) { /* we are using MAIL environment var. type mbox */ - DMA(DEBUG_INFO, "Using /var/mail/%s.\n", m); - strcpy(mbox[0].path, "/var/mail/"); + DMA(DEBUG_INFO, "Using " _PATH_MAILDIR "/%s.\n", m); + strcpy(mbox[0].path, _PATH_MAILDIR); strcat(mbox[0].path, m); } else { DMA(DEBUG_ERROR, "Cannot open config file '%s' nor use the "