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

Diff for /src/usr.bin/tmux/cmd.c between version 1.34 and 1.35

version 1.34, 2009/12/01 18:42:38 version 1.35, 2009/12/03 22:50:10
Line 169 
Line 169 
         int     i;          int     i;
   
         if (argc == 0)          if (argc == 0)
                 return;                  return;
         for (i = 0; i < argc; i++) {          for (i = 0; i < argc; i++) {
                 if (argv[i] != NULL)                  if (argv[i] != NULL)
                         xfree(argv[i]);                          xfree(argv[i]);
Line 510 
Line 510 
          * be unique so an exact match can't be ambigious and can just be           * be unique so an exact match can't be ambigious and can just be
          * returned.           * returned.
          */           */
         for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {          for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
                 if ((s = ARRAY_ITEM(&sessions, i)) == NULL)                  if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
                         continue;                          continue;
                 if (strcmp(name, s->name) == 0)                  if (strcmp(name, s->name) == 0)
Line 522 
Line 522 
          * be ambiguous.           * be ambiguous.
          */           */
         sfound = NULL;          sfound = NULL;
         for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {          for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
                 if ((s = ARRAY_ITEM(&sessions, i)) == NULL)                  if ((s = ARRAY_ITEM(&sessions, i)) == NULL)
                         continue;                          continue;
                 if (strncmp(name, s->name, strlen(name)) == 0 ||                  if (strncmp(name, s->name, strlen(name)) == 0 ||
Line 534 
Line 534 
                         sfound = s;                          sfound = s;
                 }                  }
         }          }
         return (sfound);          return (sfound);
 }  }
   
 /*  /*
Line 558 
Line 558 
                 if ((wl = winlink_find_by_index(&s->windows, idx)) != NULL)                  if ((wl = winlink_find_by_index(&s->windows, idx)) != NULL)
                         return (wl);                          return (wl);
         }          }
   
         /* Look for exact matches, error if more than one. */          /* Look for exact matches, error if more than one. */
         wlfound = NULL;          wlfound = NULL;
         RB_FOREACH(wl, winlinks, &s->windows) {          RB_FOREACH(wl, winlinks, &s->windows) {
Line 584 
Line 584 
                         }                          }
                         wlfound = wl;                          wlfound = wl;
                 }                  }
         }          }
         if (wlfound != NULL)          if (wlfound != NULL)
                 return (wlfound);                  return (wlfound);
   
Line 707 
Line 707 
                 wl = s->curw;                  wl = s->curw;
         else if ((wl = cmd_lookup_window(s, winptr, &ambiguous)) == NULL)          else if ((wl = cmd_lookup_window(s, winptr, &ambiguous)) == NULL)
                 goto not_found;                  goto not_found;
   
         if (sessptr != NULL)          if (sessptr != NULL)
                 xfree(sessptr);                  xfree(sessptr);
         return (wl);          return (wl);
Line 808 
Line 808 
                 ctx->error(ctx, "invalid index: %s", arg);                  ctx->error(ctx, "invalid index: %s", arg);
                 idx = -2;                  idx = -2;
         }          }
   
         if (sessptr != NULL)          if (sessptr != NULL)
                 xfree(sessptr);                  xfree(sessptr);
         return (idx);          return (idx);
Line 830 
Line 830 
   
 no_session:  no_session:
         if (ambiguous)          if (ambiguous)
                 ctx->error(ctx, "multiple sessions: %s", arg);                  ctx->error(ctx, "multiple sessions: %s", arg);
         else          else
                 ctx->error(ctx, "session not found: %s", arg);                  ctx->error(ctx, "session not found: %s", arg);
         if (sessptr != NULL)          if (sessptr != NULL)
Line 918 
Line 918 
         /* Try index in the current session and window. */          /* Try index in the current session and window. */
         if ((*wpp = window_pane_at_index(s->curw->window, idx)) == NULL)          if ((*wpp = window_pane_at_index(s->curw->window, idx)) == NULL)
                 goto lookup_window;                  goto lookup_window;
   
         return (s->curw);          return (s->curw);
   
 lookup_window:  lookup_window:
Line 926 
Line 926 
         if ((wl = cmd_find_window(ctx, arg, sp)) != NULL)          if ((wl = cmd_find_window(ctx, arg, sp)) != NULL)
                 *wpp = wl->window->active;                  *wpp = wl->window->active;
         return (wl);          return (wl);
   
 error:  error:
         xfree(winptr);          xfree(winptr);
         return (NULL);          return (NULL);

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35