109{
110 boost::lock_guard<boost::mutex> lock(sync_mutex);
111#if RL_READLINE_VERSION < 0x0700
112 char lbuf[2] = {0,0};
113 char *line = NULL;
114 int end = 0, point = 0;
115#endif
116
117 if (rl_end || (rl_prompt && *rl_prompt))
118 {
119#if RL_READLINE_VERSION >= 0x0700
120 rl_clear_visible_line();
121#else
122 line = rl_line_buffer;
123 end = rl_end;
124 point = rl_point;
125 rl_line_buffer = lbuf;
126 rl_end = 0;
127 rl_point = 0;
128 rl_save_prompt();
129 rl_redisplay();
130#endif
131 }
132
133 do
134 {
135 m_cout_buf->sputc( this->sgetc() );
136 }
137 while ( this->snextc() != EOF );
138
139#if RL_READLINE_VERSION < 0x0700
140 if (end || (rl_prompt && *rl_prompt))
141 {
142 rl_restore_prompt();
143 rl_line_buffer = line;
144 rl_end = end;
145 rl_point = point;
146 }
147#endif
148 rl_on_new_line();
149 rl_redisplay();
150
151 return 0;
152}