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)
Oct 3 2024, 1:40 PM
Unknown Object (File)
Oct 2 2024, 10:40 PM
Unknown Object (File)
Oct 1 2024, 3:07 PM
Unknown Object (File)
Sep 30 2024, 11:44 PM
Unknown Object (File)
Sep 27 2024, 5:26 PM
Unknown Object (File)
Sep 27 2024, 4:20 PM
Unknown Object (File)
Sep 25 2024, 7:39 PM
Unknown Object (File)
Sep 23 2024, 11:10 AM
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 Passed
Unit
No Test Coverage
Build Status
Buildable 4017
Build 4060: arc lint + arc unit

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.