summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2020-10-20 19:30:15 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2020-10-20 19:30:15 +0000
commit53f032a527232f6a8d7dcc7952d64fcb4440d157 (patch)
treef213452449c12347c9a9192c5d49e96a2756c737 /lib/libc
parentcabc89bed5cb0c59a140dd68127c40c4a4605021 (diff)
Align the basename(3) and dirname(3) prototypes with the POSIX spec:
Both functions take a non-const parameter. Implementations may modify the passed string, even though ours do not. ok stsp@ deraadt@ millert@
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/basename.36
-rw-r--r--lib/libc/gen/basename.c4
-rw-r--r--lib/libc/gen/dirname.36
-rw-r--r--lib/libc/gen/dirname.c4
4 files changed, 10 insertions, 10 deletions
diff --git a/lib/libc/gen/basename.3 b/lib/libc/gen/basename.3
index 5ac2759afff..393765bbf34 100644
--- a/lib/libc/gen/basename.3
+++ b/lib/libc/gen/basename.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: basename.3,v 1.24 2019/01/25 00:19:25 millert Exp $
+.\" $OpenBSD: basename.3,v 1.25 2020/10/20 19:30:14 naddy Exp $
.\"
.\" Copyright (c) 1997 Todd C. Miller <millert@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: January 25 2019 $
+.Dd $Mdocdate: October 20 2020 $
.Dt BASENAME 3
.Os
.Sh NAME
@@ -23,7 +23,7 @@
.Sh SYNOPSIS
.In libgen.h
.Ft char *
-.Fn basename "const char *path"
+.Fn basename "char *path"
.Sh DESCRIPTION
The
.Fn basename
diff --git a/lib/libc/gen/basename.c b/lib/libc/gen/basename.c
index 2081cb95a28..721f33d76d4 100644
--- a/lib/libc/gen/basename.c
+++ b/lib/libc/gen/basename.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: basename.c,v 1.16 2019/01/25 00:19:25 millert Exp $ */
+/* $OpenBSD: basename.c,v 1.17 2020/10/20 19:30:14 naddy Exp $ */
/*
* Copyright (c) 1997, 2004 Todd C. Miller <millert@openbsd.org>
@@ -22,7 +22,7 @@
#include <string.h>
char *
-basename(const char *path)
+basename(char *path)
{
static char bname[PATH_MAX];
size_t len;
diff --git a/lib/libc/gen/dirname.3 b/lib/libc/gen/dirname.3
index c8af757b8ee..76c191304e9 100644
--- a/lib/libc/gen/dirname.3
+++ b/lib/libc/gen/dirname.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: dirname.3,v 1.23 2019/03/08 17:33:23 benno Exp $
+.\" $OpenBSD: dirname.3,v 1.24 2020/10/20 19:30:14 naddy Exp $
.\"
.\" Copyright (c) 1997 Todd C. Miller <millert@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: March 8 2019 $
+.Dd $Mdocdate: October 20 2020 $
.Dt DIRNAME 3
.Os
.Sh NAME
@@ -23,7 +23,7 @@
.Sh SYNOPSIS
.In libgen.h
.Ft char *
-.Fn dirname "const char *path"
+.Fn dirname "char *path"
.Sh DESCRIPTION
The
.Fn dirname
diff --git a/lib/libc/gen/dirname.c b/lib/libc/gen/dirname.c
index 7a5d83b91e0..9cc32eab681 100644
--- a/lib/libc/gen/dirname.c
+++ b/lib/libc/gen/dirname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dirname.c,v 1.16 2019/01/25 00:19:25 millert Exp $ */
+/* $OpenBSD: dirname.c,v 1.17 2020/10/20 19:30:14 naddy Exp $ */
/*
* Copyright (c) 1997, 2004 Todd C. Miller <millert@openbsd.org>
@@ -24,7 +24,7 @@
/* A slightly modified copy of this file exists in libexec/ld.so */
char *
-dirname(const char *path)
+dirname(char *path)
{
static char dname[PATH_MAX];
size_t len;