home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff319.lzh
/
CNewsSrc
/
cnews.orig.lzh
/
libbsd42
/
getcwd.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-06-27
|
429b
|
31 lines
/*
* SystemV getcwd simulation on 4.2BSD
*/
#include <stdio.h>
#include <sys/param.h>
/* imports from libc */
extern char *getwd();
extern char *strncpy();
char *
getcwd(path, size)
register char *path;
int size;
{
if (size >= MAXPATHLEN)
return getwd(path);
else {
char wd[MAXPATHLEN];
if (getwd(wd) == 0)
return 0;
else {
(void) strncpy(path, wd, size-1);
path[size-1] = '\0';
return path;
}
}
}