[PATCH 5/6] Fix fflush handling for mmap files after ungetc (bug 32535)

DJ Delorie dj@redhat.com
Tue Jan 21 02:28:28 GMT 2025


Joseph Myers <josmyers@redhat.com> writes:
>> > +	  _IO_switch_to_main_get_area (fp);
>> > +	  o -= fp->_IO_read_end - fp->_IO_read_base;
>> 
>> Shouldn't one of these be _IO_read_ptr ?
>
> _IO_switch_to_main_get_area includes "fp->_IO_read_ptr = 
> fp->_IO_read_base;".  (This logic is actually emulating the use of 
> "fp->_IO_save_end - fp->_IO_save_base" in ftell and related functions.)

Hmmm... that sounds like it's propogating a bad idea, in case
_IO_switch_to_main_get_area stops making that promise.  But that's a
problem for another day...



Reviewed-by: DJ Delorie <dj@redhat.com>



More information about the Libc-alpha mailing list