[BACK]Return to status.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/status.c between version 1.40 and 1.41

version 1.40, 2009/11/04 20:35:19 version 1.41, 2009/11/04 21:04:43
Line 486 
Line 486 
 void  void
 status_job_callback(struct job *job)  status_job_callback(struct job *job)
 {  {
         char    *buf;          char    *line, *buf;
         size_t   len;          size_t   len;
   
         len = BUFFER_USED(job->out);          buf = NULL;
         buf = xmalloc(len + 1);          if ((line = evbuffer_readline(job->event->input)) == NULL) {
         if (len != 0)                  len = EVBUFFER_LENGTH(job->event->input);
                 buffer_read(job->out, buf, len);                  buf = xmalloc(len + 1);
         buf[len] = '\0';                  if (len != 0)
         buf[strcspn(buf, "\n")] = '\0';                          memcpy(buf, EVBUFFER_DATA(job->event->input), len);
                   buf[len] = '\0';
           }
   
         if (job->data != NULL)          if (job->data != NULL)
                 xfree(job->data);                  xfree(job->data);
         else          else
                 server_redraw_client(job->client);                  server_redraw_client(job->client);
         job->data = xstrdup(buf);          job->data = xstrdup(line);
   
         xfree(buf);          if (buf != NULL)
                   xfree(buf);
 }  }
   
 size_t  size_t

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41