Page MenuHomeFreeBSD

find: Fix -printf
ClosedPublic

Authored by des on Aug 6 2025, 10:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 12:07 AM
Unknown Object (File)
Sat, Oct 11, 12:07 AM
Unknown Object (File)
Sat, Oct 11, 12:07 AM
Unknown Object (File)
Fri, Oct 10, 5:40 PM
Unknown Object (File)
Fri, Oct 10, 5:40 PM
Unknown Object (File)
Fri, Oct 10, 12:35 PM
Unknown Object (File)
Wed, Sep 17, 4:40 AM
Unknown Object (File)
Sep 16 2025, 8:26 AM
Subscribers

Details

Summary

Each -printf invocation created a memstream, then freed the underlying
buffer without closing the stream, resulting in a segfault on exit
when libc tried to flush all the streams.

While here, simplify the implementation of %h.

Fixes: 7b9c912c41f4

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Aug 6 2025, 10:16 PM
des created this revision.
des edited the summary of this revision. (Show Details)

drop memstream

We should also try to figure out a way to call escape() only once.

This looks good. It matches what I have, plus fixes 'h'. So go ahead and test/commit it.

This revision is now accepted and ready to land.Aug 6 2025, 10:25 PM
des edited the summary of this revision. (Show Details)

more

This revision now requires review to proceed.Aug 6 2025, 11:58 PM
This revision is now accepted and ready to land.Aug 7 2025, 1:07 AM
This revision was automatically updated to reflect the committed changes.