Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/lib/libc/gen Pull up revision 1.8 (requested by thorpej...
details: https://anonhg.NetBSD.org/src/rev/74ad2b2ce22b
branches: netbsd-1-6
changeset: 529691:74ad2b2ce22b
user: he <he%NetBSD.org@localhost>
date: Sat Dec 07 22:18:46 2002 +0000
description:
Pull up revision 1.8 (requested by thorpej in ticket #918):
Change basename(3) and dirname(3) to return a pointer to
static storage instead of modifying their arguments. Fixes
PR#18647.
diffstat:
lib/libc/gen/basename.3 | 23 +++++++++++++++++------
lib/libc/gen/dirname.3 | 23 +++++++++++++++++------
2 files changed, 34 insertions(+), 12 deletions(-)
diffs (98 lines):
diff -r adc4674bf7bf -r 74ad2b2ce22b lib/libc/gen/basename.3
--- a/lib/libc/gen/basename.3 Sat Dec 07 22:12:07 2002 +0000
+++ b/lib/libc/gen/basename.3 Sat Dec 07 22:18:46 2002 +0000
@@ -1,10 +1,10 @@
-.\" $NetBSD: basename.3,v 1.7 2002/02/07 07:00:10 ross Exp $
+.\" $NetBSD: basename.3,v 1.7.2.1 2002/12/07 22:18:46 he Exp $
.\"
-.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
+.\" Copyright (c) 1997, 2002 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
-.\" by Klaus Klein.
+.\" by Klaus Klein and Jason R. Thorpe.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -34,7 +34,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd October 31, 1997
+.Dd October 16, 2002
.Dt BASENAME 3
.Os
.Sh NAME
@@ -76,9 +76,20 @@
.Bl -bullet -compact
.It
.St -xpg4.2
+.It
+.St -p1003.1-2001
.El
.Sh BUGS
+If the length of the result is longer than
+.Dv PATH_MAX
+bytes
+.Pq including the terminating nul ,
+the result will be truncated.
+.Pp
The
.Fn basename
-function may modify the string pointed to by
-.Ar path .
+function returns a pointer to static storage that may be overwritten
+by subsequent calls to
+.Fn basename .
+This is not strictly a bug; it is explcitly allowed by
+.St -p1003.1-2001 .
diff -r adc4674bf7bf -r 74ad2b2ce22b lib/libc/gen/dirname.3
--- a/lib/libc/gen/dirname.3 Sat Dec 07 22:12:07 2002 +0000
+++ b/lib/libc/gen/dirname.3 Sat Dec 07 22:18:46 2002 +0000
@@ -1,10 +1,10 @@
-.\" $NetBSD: dirname.3,v 1.7 2002/02/07 07:00:11 ross Exp $
+.\" $NetBSD: dirname.3,v 1.7.2.1 2002/12/07 22:18:46 he Exp $
.\"
-.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
+.\" Copyright (c) 1997, 2002 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
-.\" by Klaus Klein.
+.\" by Klaus Klein and Jason R. Thorpe.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -34,7 +34,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd November 2, 1997
+.Dd October 16, 2002
.Dt DIRNAME 3
.Os
.Sh NAME
@@ -79,9 +79,20 @@
.Bl -bullet -compact
.It
.St -xpg4.2
+.It
+.St -p1003.1-2001
.El
.Sh BUGS
+If the length of the result is longer than
+.Dv PATH_MAX
+bytes
+.Pq including the terminating nul ,
+the result will be truncated.
+.Pp
The
.Fn dirname
-function may modify the string pointed to by
-.Ar path .
+function returns a pointer to static storage that may be overwritten
+by subsequent calls to
+.Fn dirname .
+This is not strictly a bug; it is explicitly allowed by
+.St -p1003.1-2001 .
Home |
Main Index |
Thread Index |
Old Index