From 12c36f4d0aeff8190603816ad3c8d018087ac35f Mon Sep 17 00:00:00 2001 From: Unknown User d91-jda Date: Wed, 1 May 1996 15:22:29 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@454 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/getcwd.c | 17 +++++++++++++++++ lib/roken/roken.h | 4 ++++ lib/roken/roken.h.in | 4 ++++ 3 files changed, 25 insertions(+) create mode 100644 lib/roken/getcwd.c diff --git a/lib/roken/getcwd.c b/lib/roken/getcwd.c new file mode 100644 index 000000000..4053bdaa0 --- /dev/null +++ b/lib/roken/getcwd.c @@ -0,0 +1,17 @@ +#ifdef HAVE_CONFIG_H +#include +RCSID("$Id$"); +#endif + +#include + +char* +getcwd(char *path, int size) +{ + char xxx[MAXPATHLEN]; + char *ret; + ret = getwd(xxx); + if(ret) + strncpy(path, xxx, size); + return ret; +} diff --git a/lib/roken/roken.h b/lib/roken/roken.h index c9286cb5e..a698363f5 100644 --- a/lib/roken/roken.h +++ b/lib/roken/roken.h @@ -47,4 +47,8 @@ int inet_aton(char *cp, struct in_addr *adr); #endif #endif +#if !defined(HAVE_GETCWD) || defined(BROKEN_GETCWD) +char* getcwd(char *path, int size) +#endif + #endif /* __ROKEN_H__ */ diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index c9286cb5e..a698363f5 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -47,4 +47,8 @@ int inet_aton(char *cp, struct in_addr *adr); #endif #endif +#if !defined(HAVE_GETCWD) || defined(BROKEN_GETCWD) +char* getcwd(char *path, int size) +#endif + #endif /* __ROKEN_H__ */