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

Diff for /src/usr.bin/tmux/window.c between version 1.120 and 1.121

version 1.120, 2015/04/21 22:38:50 version 1.121, 2015/04/22 15:05:03
Line 245 
Line 245 
         }          }
 }  }
   
 int  
 window_index(struct window *s, u_int *i)  
 {  
         for (*i = 0; *i < ARRAY_LENGTH(&windows); (*i)++) {  
                 if (s == ARRAY_ITEM(&windows, *i))  
                         return (0);  
         }  
         return (-1);  
 }  
   
 struct window *  struct window *
 window_find_by_id(u_int id)  window_find_by_id(u_int id)
 {  {
Line 341 
Line 331 
   
         window_unzoom(w);          window_unzoom(w);
   
         if (window_index(w, &i) != 0)          for (i = 0; i < ARRAY_LENGTH(&windows); i++) {
                   if (w == ARRAY_ITEM(&windows, i))
                           break;
           }
           if (i == ARRAY_LENGTH(&windows))
                 fatalx("index not found");                  fatalx("index not found");
         ARRAY_SET(&windows, i, NULL);          ARRAY_SET(&windows, i, NULL);
         while (!ARRAY_EMPTY(&windows) && ARRAY_LAST(&windows) == NULL)          while (!ARRAY_EMPTY(&windows) && ARRAY_LAST(&windows) == NULL)

Legend:
Removed from v.1.120  
changed lines
  Added in v.1.121