[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.93 and 1.94

version 1.93, 2012/07/09 09:55:57 version 1.94, 2012/07/10 11:53:01
Line 222 
Line 222 
         /* Calculate the total size needed for the window list. */          /* Calculate the total size needed for the window list. */
         wlstart = wloffset = wlwidth = 0;          wlstart = wloffset = wlwidth = 0;
         RB_FOREACH(wl, winlinks, &s->windows) {          RB_FOREACH(wl, winlinks, &s->windows) {
                 if (wl->status_text != NULL)                  free(wl->status_text);
                         xfree(wl->status_text);  
                 memcpy(&wl->status_cell, &stdgc, sizeof wl->status_cell);                  memcpy(&wl->status_cell, &stdgc, sizeof wl->status_cell);
                 wl->status_text = status_print(c, wl, t, &wl->status_cell);                  wl->status_text = status_print(c, wl, t, &wl->status_cell);
                 wl->status_width =                  wl->status_width =
Line 372 
Line 371 
         screen_write_stop(&ctx);          screen_write_stop(&ctx);
   
 out:  out:
         if (left != NULL)          free(left);
                 xfree(left);          free(right);
         if (right != NULL)  
                 xfree(right);  
   
         if (grid_compare(c->status.grid, old_status.grid) == 0) {          if (grid_compare(c->status.grid, old_status.grid) == 0) {
                 screen_free(&old_status);                  screen_free(&old_status);
Line 491 
Line 488 
         }          }
   
 out:  out:
         if (freeptr != NULL)          free(freeptr);
                 xfree(freeptr);  
         return;          return;
   
 skip_to:  skip_to:
Line 572 
Line 568 
                 cmd[len++] = **iptr;                  cmd[len++] = **iptr;
         }          }
         if (**iptr == '\0')             /* no terminating ) */ {          if (**iptr == '\0')             /* no terminating ) */ {
                 xfree(cmd);                  free(cmd);
                 return (NULL);                  return (NULL);
         }          }
         (*iptr)++;                      /* skip final ) */          (*iptr)++;                      /* skip final ) */
Line 582 
Line 578 
         so_find.cmd = cmd;          so_find.cmd = cmd;
         so = RB_FIND(status_out_tree, &c->status_new, &so_find);          so = RB_FIND(status_out_tree, &c->status_new, &so_find);
         if (so != NULL && so->out != NULL) {          if (so != NULL && so->out != NULL) {
                 xfree(cmd);                  free(cmd);
                 return (so->out);                  return (so->out);
         }          }
   
Line 600 
Line 596 
         /* Lookup in the old tree. */          /* Lookup in the old tree. */
         so_find.cmd = cmd;          so_find.cmd = cmd;
         so = RB_FIND(status_out_tree, &c->status_old, &so_find);          so = RB_FIND(status_out_tree, &c->status_old, &so_find);
         xfree(cmd);          free(cmd);
         if (so != NULL)          if (so != NULL)
                 return (so->out);                  return (so->out);
         return (NULL);          return (NULL);
Line 618 
Line 614 
                 so_next = RB_NEXT(status_out_tree, sotree, so);                  so_next = RB_NEXT(status_out_tree, sotree, so);
   
                 RB_REMOVE(status_out_tree, sotree, so);                  RB_REMOVE(status_out_tree, sotree, so);
                 if (so->out != NULL)                  free(so->out);
                         xfree(so->out);                  free(so->cmd);
                 xfree(so->cmd);                  free(so);
                 xfree(so);  
         }          }
 }  }
   
Line 778 
Line 773 
                 limit = ARRAY_LENGTH(&c->message_log) - limit;                  limit = ARRAY_LENGTH(&c->message_log) - limit;
                 for (i = 0; i < limit; i++) {                  for (i = 0; i < limit; i++) {
                         msg = &ARRAY_FIRST(&c->message_log);                          msg = &ARRAY_FIRST(&c->message_log);
                         xfree(msg->msg);                          free(msg->msg);
                         ARRAY_REMOVE(&c->message_log, 0);                          ARRAY_REMOVE(&c->message_log, 0);
                 }                  }
         }          }
Line 803 
Line 798 
         if (c->message_string == NULL)          if (c->message_string == NULL)
                 return;                  return;
   
         xfree(c->message_string);          free(c->message_string);
         c->message_string = NULL;          c->message_string = NULL;
   
         c->tty.flags &= ~(TTY_NOCURSOR|TTY_FREEZE);          c->tty.flags &= ~(TTY_NOCURSOR|TTY_FREEZE);
Line 912 
Line 907 
         if (c->prompt_freefn != NULL && c->prompt_data != NULL)          if (c->prompt_freefn != NULL && c->prompt_data != NULL)
                 c->prompt_freefn(c->prompt_data);                  c->prompt_freefn(c->prompt_data);
   
         xfree(c->prompt_string);          free(c->prompt_string);
         c->prompt_string = NULL;          c->prompt_string = NULL;
   
         xfree(c->prompt_buffer);          free(c->prompt_buffer);
         c->prompt_buffer = NULL;          c->prompt_buffer = NULL;
   
         c->tty.flags &= ~(TTY_NOCURSOR|TTY_FREEZE);          c->tty.flags &= ~(TTY_NOCURSOR|TTY_FREEZE);
Line 928 
Line 923 
 void  void
 status_prompt_update(struct client *c, const char *msg, const char *input)  status_prompt_update(struct client *c, const char *msg, const char *input)
 {  {
         xfree(c->prompt_string);          free(c->prompt_string);
         c->prompt_string = status_replace(c, NULL, NULL, NULL, msg,          c->prompt_string = status_replace(c, NULL, NULL, NULL, msg,
             time(NULL), 0);              time(NULL), 0);
   
         xfree(c->prompt_buffer);          free(c->prompt_buffer);
         c->prompt_buffer = status_replace(c, NULL, NULL, NULL, input,          c->prompt_buffer = status_replace(c, NULL, NULL, NULL, input,
             time(NULL), 0);              time(NULL), 0);
         c->prompt_index = strlen(c->prompt_buffer);          c->prompt_index = strlen(c->prompt_buffer);
Line 1109 
Line 1104 
                 memcpy(first, s, strlen(s));                  memcpy(first, s, strlen(s));
   
                 c->prompt_index = (first - c->prompt_buffer) + strlen(s);                  c->prompt_index = (first - c->prompt_buffer) + strlen(s);
                 xfree(s);                  free(s);
   
                 c->flags |= CLIENT_STATUS;                  c->flags |= CLIENT_STATUS;
                 break;                  break;
Line 1250 
Line 1245 
                 histstr = status_prompt_up_history(&c->prompt_hindex);                  histstr = status_prompt_up_history(&c->prompt_hindex);
                 if (histstr == NULL)                  if (histstr == NULL)
                         break;                          break;
                 xfree(c->prompt_buffer);                  free(c->prompt_buffer);
                 c->prompt_buffer = xstrdup(histstr);                  c->prompt_buffer = xstrdup(histstr);
                 c->prompt_index = strlen(c->prompt_buffer);                  c->prompt_index = strlen(c->prompt_buffer);
                 c->flags |= CLIENT_STATUS;                  c->flags |= CLIENT_STATUS;
Line 1259 
Line 1254 
                 histstr = status_prompt_down_history(&c->prompt_hindex);                  histstr = status_prompt_down_history(&c->prompt_hindex);
                 if (histstr == NULL)                  if (histstr == NULL)
                         break;                          break;
                 xfree(c->prompt_buffer);                  free(c->prompt_buffer);
                 c->prompt_buffer = xstrdup(histstr);                  c->prompt_buffer = xstrdup(histstr);
                 c->prompt_index = strlen(c->prompt_buffer);                  c->prompt_index = strlen(c->prompt_buffer);
                 c->flags |= CLIENT_STATUS;                  c->flags |= CLIENT_STATUS;
Line 1383 
Line 1378 
                 return;                  return;
   
         if (size == PROMPT_HISTORY) {          if (size == PROMPT_HISTORY) {
                 xfree(ARRAY_FIRST(&status_prompt_history));                  free(ARRAY_FIRST(&status_prompt_history));
                 ARRAY_REMOVE(&status_prompt_history, 0);                  ARRAY_REMOVE(&status_prompt_history, 0);
         }          }
   

Legend:
Removed from v.1.93  
changed lines
  Added in v.1.94