version 1.1.1.2, 1995/02/25 09:11:43 |
version 1.6, 1997/07/13 19:00:40 |
|
|
|
/* $NetBSD$ */ |
|
|
/* |
/* |
* Copyright (c) 1989, 1991, 1993 |
* Copyright (c) 1989, 1991, 1993 |
* The Regents of the University of California. All rights reserved. |
* The Regents of the University of California. All rights reserved. |
|
|
* SUCH DAMAGE. |
* SUCH DAMAGE. |
*/ |
*/ |
|
|
|
#include <sys/cdefs.h> |
#if defined(LIBC_SCCS) && !defined(lint) |
#if defined(LIBC_SCCS) && !defined(lint) |
|
#if 0 |
static char sccsid[] = "@(#)getcwd.c 8.1 (Berkeley) 6/4/93"; |
static char sccsid[] = "@(#)getcwd.c 8.1 (Berkeley) 6/4/93"; |
|
#else |
|
__RCSID("$NetBSD$"); |
|
#endif |
#endif /* LIBC_SCCS and not lint */ |
#endif /* LIBC_SCCS and not lint */ |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
Line 47 static char sccsid[] = "@(#)getcwd.c 8.1 |
|
Line 54 static char sccsid[] = "@(#)getcwd.c 8.1 |
|
|
|
#define ISDOT(dp) \ |
#define ISDOT(dp) \ |
(dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \ |
(dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \ |
dp->d_name[1] == '.' && dp->d_name[2] == '\0')) |
(dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) |
|
|
char * |
char * |
getcwd(pt, size) |
getcwd(pt, size) |
Line 124 getcwd(pt, size) |
|
Line 131 getcwd(pt, size) |
|
* path to the beginning of the buffer, but it's always |
* path to the beginning of the buffer, but it's always |
* been that way and stuff would probably break. |
* been that way and stuff would probably break. |
*/ |
*/ |
(void)bcopy(bpt, pt, ept - bpt); |
bcopy(bpt, pt, ept - bpt); |
free(up); |
free(up); |
return (pt); |
return (pt); |
} |
} |
Line 200 getcwd(pt, size) |
|
Line 207 getcwd(pt, size) |
|
goto err; |
goto err; |
bpt = pt + off; |
bpt = pt + off; |
ept = pt + ptsize; |
ept = pt + ptsize; |
(void)bcopy(bpt, ept - len, len); |
bcopy(bpt, ept - len, len); |
bpt = ept - len; |
bpt = ept - len; |
} |
} |
if (!first) |
if (!first) |