dos_compilers/Manx Aztec C86 v52a/LIB/DOS/GETCWD.C
2024-07-02 08:25:54 -07:00

22 lines
319 B
C

/* Copyright (C) 1984 by Manx Software Systems */
char *
getcwd(buf, size)
char *buf;
{
char *_malloc();
int allflag = 0;
if (buf == 0) {
if ((buf = _malloc(size)) == 0)
return 0;
allflag = 1;
}
if (_sys(0x47,buf,0) == -1) {
if (allflag)
free(buf);
return 0;
}
return buf;
}