Fix tips of the day not being translated.
Do not discard the buffer on the very first underflow, it may already contain data, especially the textdomain.
This commit is contained in:
parent
781cacb803
commit
eb83f2caf6
1 changed files with 13 additions and 10 deletions
|
@ -96,17 +96,20 @@ preprocessor_streambuf::preprocessor_streambuf(preprocessor_streambuf const &t)
|
|||
|
||||
int preprocessor_streambuf::underflow()
|
||||
{
|
||||
if (gptr() < egptr())
|
||||
return *gptr();
|
||||
// the buffer has been completely read; fill it again
|
||||
// keep part of the previous buffer, to ensure putback capabilities
|
||||
unsigned sz = out_buffer_.size();
|
||||
if (sz > 3) {
|
||||
out_buffer_ = out_buffer_.substr(sz - 3);
|
||||
sz = 3;
|
||||
unsigned sz = 0;
|
||||
if (char *gp = gptr()) {
|
||||
if (gp < egptr())
|
||||
return *gp;
|
||||
// the buffer has been completely read; fill it again
|
||||
// keep part of the previous buffer, to ensure putback capabilities
|
||||
sz = out_buffer_.size();
|
||||
if (sz > 3) {
|
||||
out_buffer_ = out_buffer_.substr(sz - 3);
|
||||
sz = 3;
|
||||
}
|
||||
buffer_.str(std::string());
|
||||
buffer_ << out_buffer_;
|
||||
}
|
||||
buffer_.str(std::string());
|
||||
buffer_ << out_buffer_;
|
||||
while (current_) {
|
||||
if (current_->get_chunk()) {
|
||||
if (buffer_.str().size() >= 2000)
|
||||
|
|
Loading…
Add table
Reference in a new issue