commit | 37e18b7bf307fa4a8c745feebfcba54a0ba74f30 | [log] [tgz] |
---|---|---|
author | Rich Felker <dalias@aerifal.cx> | Wed Aug 17 18:34:07 2022 -0400 |
committer | Rich Felker <dalias@aerifal.cx> | Wed Aug 17 18:34:07 2022 -0400 |
tree | 79a850217e80e1e6570cdf685b41b2d8c3c20252 | |
parent | bf99258564fd5b58974d93201ab61506eb8cb03e [diff] |
freopen: reset stream orientation (byte/wide) and encoding rule this is a requirement of the C language (orientation) and POSIX (encoding rule) that was somehow overlooked. we rely on the fact that the buffer pointers have been reset by fflush, so that any future stdio operations on the stream will go through the same code paths they would on a newly-opened file without an orientation set, thereby setting the orientation as they should.