Page MenuHomeFreeBSD

find: Fix -printf
ClosedPublic

Authored by des on Wed, Aug 6, 10:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Aug 19, 7:37 PM
Unknown Object (File)
Tue, Aug 19, 6:48 PM
Unknown Object (File)
Tue, Aug 19, 6:40 PM
Unknown Object (File)
Tue, Aug 19, 6:36 PM
Unknown Object (File)
Tue, Aug 19, 6:14 PM
Unknown Object (File)
Tue, Aug 19, 6:09 PM
Unknown Object (File)
Tue, Aug 19, 4:25 PM
Unknown Object (File)
Tue, Aug 19, 10:33 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.Wed, Aug 6, 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.Wed, Aug 6, 10:25 PM
des edited the summary of this revision. (Show Details)

more

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