Re: Bug in external editor code



On 2002.01.24 19:05 Carlos Morgado wrote:
> 
> Em Qui, 24 Jan 2002 20:41:40 Peter Bloomfield escreveu:
>> On 2002.01.24 14:26 Jacob Ilsų Christensen wrote:
>>> Hi.
>>> 
>>> When invoking an external editor to edit stuff already in the send 
>>> message window the last line is duplicated if it contains only a 
>>> newline character.
>> 
>> It didn't for me (glibc-2.2.4-19.3). Is there a buggy fgets around?
> 
> does for me. rh7.2
> 
>-- 
> Carlos Morgado

That's weird--it does for me too, in a simple test program, though it 
didn't seem to when spawning the external editor!

Anyway, a simpler fix seems to be to replace

     while(!feof(tmp)) {
         fgets(line, 80, tmp);
         
gtk_editable_insert_text(GTK_EDITABLE(data_real->msg->text),line,
                                  strlen(line), &curposition);
     }

with

     while (fgets(line, 80, tmp))
         gtk_editable_insert_text(GTK_EDITABLE(data_real->msg->text), 
line,
                                  strlen(line), &curposition);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]