Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 315214 Details for
Bug 457506
Can't read multibyte characters from wide-oriented unbuffered stream
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Updated patch
fix_rhbug457506-2.patch (text/plain), 2.63 KB, created by
Denys Vlasenko
on 2008-08-28 13:07:45 UTC
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Denys Vlasenko
Created:
2008-08-28 13:07:45 UTC
Size:
2.63 KB
patch
obsolete
>diff -urpN glibc-2.8.org/libio/wfileops.c glibc-2.8/libio/wfileops.c >--- glibc-2.8.org/libio/wfileops.c 2006-01-15 18:45:20.000000000 +0100 >+++ glibc-2.8/libio/wfileops.c 2008-08-28 09:55:42.000000000 +0200 >@@ -125,6 +125,12 @@ _IO_wfile_underflow (fp) > _IO_ssize_t count; > int tries; > const char *read_ptr_copy; >+ char smallbuf[MB_LEN_MAX + 2]; >+ char *sv_IO_read_ptr; >+ char *sv_IO_read_end; >+ char *sv_IO_buf_end; >+ char *sv_IO_read_base; >+ wint_t retval; > > if (__builtin_expect (fp->_flags & _IO_NO_READS, 0)) > { >@@ -236,26 +242,38 @@ _IO_wfile_underflow (fp) > fp->_wide_data->_IO_write_base = fp->_wide_data->_IO_write_ptr = > fp->_wide_data->_IO_write_end = fp->_wide_data->_IO_buf_base; > >+ /* Unbuffered stream has 1 byte buffer. This is not enough for >+ reading a wchar_t. Temporarily use local storage. */ >+ sv_IO_read_ptr = NULL; >+ if ((fp->_IO_buf_end - fp->_IO_read_end) < sizeof(smallbuf)) >+ { >+ sv_IO_read_ptr = fp->_IO_read_ptr; >+ sv_IO_read_end = fp->_IO_read_end; >+ sv_IO_buf_end = fp->_IO_buf_end; >+ sv_IO_read_base = fp->_IO_read_base; >+ fp->_IO_read_ptr = smallbuf; >+ fp->_IO_read_end = smallbuf; >+ fp->_IO_buf_end = &smallbuf[sizeof(smallbuf) - 1]; >+ } >+ > tries = 0; > again: > count = _IO_SYSREAD (fp, fp->_IO_read_end, >- fp->_IO_buf_end - fp->_IO_read_end); >+ sv_IO_read_ptr ? 1 : (fp->_IO_buf_end - fp->_IO_read_end)); > if (count <= 0) > { > if (count == 0 && tries == 0) > fp->_flags |= _IO_EOF_SEEN; > else >- fp->_flags |= _IO_ERR_SEEN, count = 0; >- } >- fp->_IO_read_end += count; >- if (count == 0) >- { >+ fp->_flags |= _IO_ERR_SEEN; > if (tries != 0) > /* There are some bytes in the external buffer but they don't > convert to anything. */ > __set_errno (EILSEQ); >- return WEOF; >+ retval = WEOF; >+ goto restore_and_ret; > } >+ fp->_IO_read_end += count; > if (fp->_offset != _IO_pos_BAD) > _IO_pos_adjust (fp->_offset, count); > >@@ -276,7 +294,8 @@ _IO_wfile_underflow (fp) > { > __set_errno (EILSEQ); > fp->_flags |= _IO_ERR_SEEN; >- return WEOF; >+ retval = WEOF; >+ goto restore_and_ret; > } > > /* The read bytes make no complete character. Try reading again. */ >@@ -285,7 +304,17 @@ _IO_wfile_underflow (fp) > goto again; > } > >- return *fp->_wide_data->_IO_read_ptr; >+ retval = *fp->_wide_data->_IO_read_ptr; >+ >+restore_and_ret: >+ if (sv_IO_read_ptr) >+ { >+ fp->_IO_read_ptr = sv_IO_read_ptr; >+ fp->_IO_read_end = sv_IO_read_end; >+ fp->_IO_buf_end = sv_IO_buf_end; >+ fp->_IO_read_base = sv_IO_read_base; >+ } >+ return retval; > } > INTDEF(_IO_wfile_underflow) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 457506
:
315076
| 315214