diff options
author | Marc Espie <espie@cvs.openbsd.org> | 1999-05-28 22:00:23 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 1999-05-28 22:00:23 +0000 |
commit | 922c6706b295a39bcd35e8c7d2940216c69f71d6 (patch) | |
tree | 7063b2e1734fd97b4e1b55c6ecf0db4009c211c5 | |
parent | ed77d8ac26b2a5d4493137d6c07dd2caf3001464 (diff) |
proper const semantics for dirname & basename.
(this follows FreeBSD and Linux. Single Unix 2 is still illogical)
-rw-r--r-- | include/libgen.h | 6 | ||||
-rw-r--r-- | lib/libc/gen/basename.3 | 4 | ||||
-rw-r--r-- | lib/libc/gen/basename.c | 6 | ||||
-rw-r--r-- | lib/libc/gen/dirname.3 | 4 | ||||
-rw-r--r-- | lib/libc/gen/dirname.c | 6 |
5 files changed, 13 insertions, 13 deletions
diff --git a/include/libgen.h b/include/libgen.h index dd53c00712b..89d0ba5ada0 100644 --- a/include/libgen.h +++ b/include/libgen.h @@ -1,4 +1,4 @@ -/* $OpenBSD: libgen.h,v 1.3 1998/06/21 22:13:36 millert Exp $ */ +/* $OpenBSD: libgen.h,v 1.4 1999/05/28 22:00:22 espie Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -34,8 +34,8 @@ __BEGIN_DECLS -char *basename __P((char *)); -char *dirname __P((char *)); +char *basename __P((const char *)); +char *dirname __P((const char *)); #if 0 char *regcmp __P((const char *, ...)); char *regex __P((const char *, const char *, ...)); diff --git a/lib/libc/gen/basename.3 b/lib/libc/gen/basename.3 index b19d7c691fb..543eb2bc0dd 100644 --- a/lib/libc/gen/basename.3 +++ b/lib/libc/gen/basename.3 @@ -24,7 +24,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $OpenBSD: basename.3,v 1.8 1999/05/28 16:28:05 espie Exp $ +.\" $OpenBSD: basename.3,v 1.9 1999/05/28 22:00:21 espie Exp $ .\" .Dd August 17, 1997 .Dt BASENAME 3 @@ -35,7 +35,7 @@ .Sh SYNOPSIS .Fd #include <libgen.h> .Ft char * -.Fn basename "char *path" +.Fn basename "const char *path" .Sh DESCRIPTION The .Fn basename diff --git a/lib/libc/gen/basename.c b/lib/libc/gen/basename.c index 41f74d2fa64..6c8b1f610a4 100644 --- a/lib/libc/gen/basename.c +++ b/lib/libc/gen/basename.c @@ -1,4 +1,4 @@ -/* $OpenBSD: basename.c,v 1.2 1998/06/21 22:13:39 millert Exp $ */ +/* $OpenBSD: basename.c,v 1.3 1999/05/28 22:00:21 espie Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -28,7 +28,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: basename.c,v 1.2 1998/06/21 22:13:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: basename.c,v 1.3 1999/05/28 22:00:21 espie Exp $"; #endif /* not lint */ #include <errno.h> @@ -38,7 +38,7 @@ static char rcsid[] = "$OpenBSD: basename.c,v 1.2 1998/06/21 22:13:39 millert Ex char * basename(path) - char *path; + const char *path; { static char bname[MAXPATHLEN]; register char *endp, *startp; diff --git a/lib/libc/gen/dirname.3 b/lib/libc/gen/dirname.3 index 029bb43c826..9a13aa5ede9 100644 --- a/lib/libc/gen/dirname.3 +++ b/lib/libc/gen/dirname.3 @@ -24,7 +24,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $OpenBSD: dirname.3,v 1.4 1999/05/27 20:49:32 aaron Exp $ +.\" $OpenBSD: dirname.3,v 1.5 1999/05/28 22:00:20 espie Exp $ .\" .Dd August 17, 1997 .Dt DIRNAME 3 @@ -35,7 +35,7 @@ .Sh SYNOPSIS .Fd #include <libgen.h> .Ft char * -.Fn dirname "char *path" +.Fn dirname "const char *path" .Sh DESCRIPTION The .Fn dirname diff --git a/lib/libc/gen/dirname.c b/lib/libc/gen/dirname.c index 10692c9eec6..23fe46691ae 100644 --- a/lib/libc/gen/dirname.c +++ b/lib/libc/gen/dirname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dirname.c,v 1.2 1998/06/21 22:13:40 millert Exp $ */ +/* $OpenBSD: dirname.c,v 1.3 1999/05/28 22:00:21 espie Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -28,7 +28,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: dirname.c,v 1.2 1998/06/21 22:13:40 millert Exp $"; +static char rcsid[] = "$OpenBSD: dirname.c,v 1.3 1999/05/28 22:00:21 espie Exp $"; #endif /* not lint */ #include <errno.h> @@ -38,7 +38,7 @@ static char rcsid[] = "$OpenBSD: dirname.c,v 1.2 1998/06/21 22:13:40 millert Exp char * dirname(path) - char *path; + const char *path; { static char bname[MAXPATHLEN]; register char *endp; |