diff -dur gcl-2.6.8.ORIG/o/unixfsys.c gcl-2.6.8/o/unixfsys.c --- gcl-2.6.8.ORIG/o/unixfsys.c 2010-03-23 09:49:59.695957414 -0600 +++ gcl-2.6.8/o/unixfsys.c 2010-03-23 09:50:57.452959648 -0600 @@ -149,18 +149,6 @@ #define MAXPATHLEN 512 #endif - -#ifdef HAVE_GETCWD -char * -getwd(char *buffer) -{ -#ifndef _WIN32 - char *getcwd(char *, size_t); -#endif - return(getcwd(buffer, MAXPATHLEN)); -} -#endif - #ifdef DGUX @@ -278,6 +266,8 @@ if ( 0 == current_directory_length ) { FEerror ( "truename could not determine the current directory.", 1, "" ); } +#elif defined(HAVE_GETCWD) + getcwd(current_directory, MAXPATHLEN); #else getcwd(current_directory,sizeof(current_directory)); #endif @@ -361,6 +351,8 @@ FEerror ( "truename could not determine the current directory.", 1, "" ); } p = directory; +#elif defined(HAVE_GETCWD) + p = getcwd(directory, MAXPATHLEN); #else p = getcwd(directory,sizeof(directory)); #endif