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

Diff for /src/usr.bin/tmux/cmd-new-window.c between version 1.96 and 1.97

version 1.96, 2021/08/27 17:25:55 version 1.97, 2023/09/01 14:24:46
Line 60 
Line 60 
         struct session          *s = target->s;          struct session          *s = target->s;
         struct winlink          *wl = target->wl, *new_wl = NULL;          struct winlink          *wl = target->wl, *new_wl = NULL;
         int                      idx = target->idx, before;          int                      idx = target->idx, before;
         char                    *cause = NULL, *cp;          char                    *cause = NULL, *cp, *expanded;
         const char              *template, *name;          const char              *template, *name;
         struct cmd_find_state    fs;          struct cmd_find_state    fs;
         struct args_value       *av;          struct args_value       *av;
Line 71 
Line 71 
          */           */
         name = args_get(args, 'n');          name = args_get(args, 'n');
         if (args_has(args, 'S') && name != NULL && target->idx == -1) {          if (args_has(args, 'S') && name != NULL && target->idx == -1) {
                   expanded = format_single(item, name, c, s, NULL, NULL);
                 RB_FOREACH(wl, winlinks, &s->windows) {                  RB_FOREACH(wl, winlinks, &s->windows) {
                         if (strcmp(wl->window->name, name) != 0)                          if (strcmp(wl->window->name, expanded) != 0)
                                 continue;                                  continue;
                         if (new_wl == NULL) {                          if (new_wl == NULL) {
                                 new_wl = wl;                                  new_wl = wl;
                                 continue;                                  continue;
                         }                          }
                         cmdq_error(item, "multiple windows named %s", name);                          cmdq_error(item, "multiple windows named %s", name);
                           free(expanded);
                         return (CMD_RETURN_ERROR);                          return (CMD_RETURN_ERROR);
                 }                  }
                   free(expanded);
                 if (new_wl != NULL) {                  if (new_wl != NULL) {
                         if (args_has(args, 'd'))                          if (args_has(args, 'd'))
                                 return (CMD_RETURN_NORMAL);                                  return (CMD_RETURN_NORMAL);

Legend:
Removed from v.1.96  
changed lines
  Added in v.1.97