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
Unknown Object (File)
Sat, Oct 11, 1:57 PM
Unknown Object (File)
Sat, Sep 27, 2:37 AM
Unknown Object (File)
Wed, Sep 24, 8:08 PM
Unknown Object (File)
Wed, Sep 17, 11:20 AM
Unknown Object (File)
Sep 15 2025, 6:10 PM
Unknown Object (File)
Sep 14 2025, 9:19 AM
Unknown Object (File)
Jul 23 2025, 3:13 PM
Unknown Object (File)
Jul 21 2025, 6:51 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.