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)
Mar 22 2024, 9:17 PM
Unknown Object (File)
Mar 22 2024, 9:17 PM
Unknown Object (File)
Mar 22 2024, 9:17 PM
Unknown Object (File)
Mar 8 2024, 11:25 AM
Unknown Object (File)
Jan 4 2024, 4:32 PM
Unknown Object (File)
Jan 4 2024, 4:31 PM
Unknown Object (File)
Jan 4 2024, 4:31 PM
Unknown Object (File)
Jan 4 2024, 3:41 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 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.