* SUCH DAMAGE.
*/
-#include "config.h"
+#include <config.h>
#include <sys/param.h>
#include <sys/stat.h>
#endif /* STDC_HEADERS */
#ifdef HAVE_STRING_H
# include <string.h>
-#else
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
#endif /* HAVE_STRING_H */
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif /* HAVE_STRINGS_H */
#if defined(HAVE_MALLOC_H) && !defined(STDC_HEADERS)
# include <malloc.h>
#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
# endif
#endif
-#include "compat.h"
+#include "missing.h"
#define ISDOT(dp) \
(dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \
(dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
-#ifndef lint
-static const char rcsid[] = "$Sudo: getcwd.c,v 1.25 2004/06/06 23:58:10 millert Exp $";
-#endif /* lint */
-
char *
getcwd(pt, size)
char *pt;
ptsize = 0;
if (!size) {
errno = EINVAL;
- return (NULL);
+ return NULL;
}
ept = pt + size;
} else {
if ((pt = malloc(ptsize = 1024 - 4)) == NULL)
- return (NULL);
+ return NULL;
ept = pt + ptsize;
}
bpt = ept - 1;
*/
bcopy(bpt, pt, ept - bpt);
free(up);
- return (pt);
+ return pt;
}
/*
free(up);
if (dir)
(void)closedir(dir);
- return (NULL);
+ return NULL;
}