$NetBSD: patch-cy,v 1.2 2004/09/30 20:38:28 kristerw Exp $ --- lib/libxview/textsw/txt_file.c.orig 1993-06-29 07:17:48.000000000 +0200 +++ lib/libxview/textsw/txt_file.c 2004-09-30 22:24:41.000000000 +0200 @@ -45,13 +45,27 @@ extern CHAR *STRCAT(); extern CHAR *STRNCAT(); -#ifdef SVR4 + +#if (defined(SVR4) || (__NetBSD_Version__ >= 103080000)) +#define GETCWD +#endif + +#ifdef GETCWD extern char *getcwd(); #else extern char *getwd(); -#endif /* SVR4 */ +#endif /* GETCWD */ +#if (defined(BSD) && (BSD >= 199306)) +#if __NetBSD_Version__ > 103080000 +#include +#else +extern int errno, sys_nerr; +extern const char *const sys_errlist[]; +#endif +#else extern int errno, sys_nerr; extern char *sys_errlist[]; +#endif Pkg_private int textsw_change_directory(); Pkg_private void textsw_display(), textsw_display_view_margins(); @@ -354,21 +368,21 @@ } #ifdef OW_I18N -#ifdef SVR4 +#ifdef GETCWD if (getcwd(pathname_mb, MAXPATHLEN) == 0) #else if (getwd(pathname_mb) == 0) -#endif /* SVR4 */ +#endif /* GETCWD */ return (0); (void) mbstowcs(pathname, pathname_mb, MAXPATHLEN-1); #else /* OW_I18N */ -#ifdef SVR4 +#ifdef GETCWD if (getcwd(pathname, MAXPATHLEN) == 0) #else if (getwd(pathname) == 0) -#endif /* SVR4 */ +#endif /* GETCWD */ return (0); #endif /* OW_I18N */