docs/82508: misleading man page for basename/dirname
Vlad Skvortsov
vss at high.net.ru
Wed Jun 22 03:00:40 UTC 2005
>Number: 82508
>Category: docs
>Synopsis: misleading man page for basename/dirname
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-doc
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: doc-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Jun 22 03:00:39 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Vlad Skvortsov
>Release: 5.2.1
>Organization:
Netli, Inc.
>Environment:
FreeBSD vlad.hq.netli.lan 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Sat May 22 11:32:00 PDT 2004 root at vlad.hq.netli.lan:/usr/obj/usr/src/sys/VLAD i386
>Description:
The man pages for both basename(3) and dirname(3) state that the functions return pointers to the internal _static_ storage. However, those functions actually perform malloc() call to allocate storage on the first invocation. Thus, the memory pointer returned is actually a pointer to internal but dynamically allocated storage.
I don't know whether this violates standard or not, but the documentation is misleading.
>How-To-Repeat:
Not applicable.
>Fix:
Fix the docs.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-doc
mailing list