Page MenuHomeFreeBSD

find: Fix -printf
ClosedPublic

Authored by des on Aug 6 2025, 10:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 27, 6:42 AM
Unknown Object (File)
Thu, Mar 26, 12:25 AM
Unknown Object (File)
Fri, Mar 20, 12:05 PM
Unknown Object (File)
Thu, Mar 19, 1:43 AM
Unknown Object (File)
Tue, Mar 17, 10:15 AM
Unknown Object (File)
Sat, Mar 14, 7:27 PM
Unknown Object (File)
Thu, Mar 12, 4:03 PM
Unknown Object (File)
Wed, Mar 11, 7:44 PM
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.