Page MenuHomeFreeBSD

Invoke the dirname() function in a POSIX compliant way.
ClosedPublic

Authored by ed on May 29 2016, 10:21 AM.
Tags
None
Referenced Files
F115240620: D6628.diff
Mon, Apr 21, 6:32 PM
Unknown Object (File)
Wed, Apr 16, 11:56 AM
Unknown Object (File)
Fri, Apr 11, 1:57 PM
Unknown Object (File)
Fri, Apr 4, 11:08 AM
Unknown Object (File)
Mar 11 2025, 9:33 PM
Unknown Object (File)
Mar 7 2025, 7:57 AM
Unknown Object (File)
Feb 20 2025, 5:21 PM
Unknown Object (File)
Feb 18 2025, 1:28 PM
Subscribers

Details

Summary

POSIX requires that the argument of dirname() is of type "char *". In
other words, the input buffer can be modified by the function to store
the directory name.

Pull a copy of the string before calling dirname(). We don't care about
freeing up the memory afterwards, as this is done at the very bottom of
main(), right before the program terminates.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ed retitled this revision from to Invoke the dirname() function in a POSIX compliant way..
ed updated this object.
ed edited the test plan for this revision. (Show Details)
ed added reviewers: bapt, se.
bapt edited edge metadata.
This revision is now accepted and ready to land.May 29 2016, 10:39 AM
This revision was automatically updated to reflect the committed changes.