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

Diff for /src/usr.bin/tmux/options.c between version 1.50 and 1.51

version 1.50, 2019/06/20 11:59:59 version 1.51, 2019/06/20 18:13:04
Line 741 
Line 741 
         struct window_pane                      *wp = fs->wp;          struct window_pane                      *wp = fs->wp;
         const char                              *target = args_get(args, 't');          const char                              *target = args_get(args, 't');
         const struct options_table_entry        *oe;          const struct options_table_entry        *oe;
         int                                      scope;          int                                      scope = OPTIONS_TABLE_NONE;
   
         if (*name == '@')          if (*name == '@')
                 return (options_scope_from_flags(args, window, fs, oo, cause));                  return (options_scope_from_flags(args, window, fs, oo, cause));
Line 754 
Line 754 
                 xasprintf(cause, "unknown option: %s", name);                  xasprintf(cause, "unknown option: %s", name);
                 return (OPTIONS_TABLE_NONE);                  return (OPTIONS_TABLE_NONE);
         }          }
         scope = oe->scope;          switch (oe->scope) {
   
         switch (scope) {  
         case OPTIONS_TABLE_SERVER:          case OPTIONS_TABLE_SERVER:
                 *oo = global_options;                  *oo = global_options;
                   scope = OPTIONS_TABLE_SERVER;
                 break;                  break;
         case OPTIONS_TABLE_SESSION:          case OPTIONS_TABLE_SESSION:
                 if (args_has(args, 'g'))                  if (args_has(args, 'g')) {
                         *oo = global_s_options;                          *oo = global_s_options;
                 else if (s == NULL && target != NULL)                          scope = OPTIONS_TABLE_SESSION;
                   } else if (s == NULL && target != NULL)
                         xasprintf(cause, "no such session: %s", target);                          xasprintf(cause, "no such session: %s", target);
                 else if (s == NULL)                  else if (s == NULL)
                         xasprintf(cause, "no current session");                          xasprintf(cause, "no current session");
                 else                  else {
                         *oo = s->options;                          *oo = s->options;
                           scope = OPTIONS_TABLE_SESSION;
                   }
                 break;                  break;
         case OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE:          case OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE:
                 if (args_has(args, 'p')) {                  if (args_has(args, 'p')) {
Line 776 
Line 778 
                                 xasprintf(cause, "no such pane: %s", target);                                  xasprintf(cause, "no such pane: %s", target);
                         else if (wp == NULL)                          else if (wp == NULL)
                                 xasprintf(cause, "no current pane");                                  xasprintf(cause, "no current pane");
                         else                          else {
                                 *oo = wp->options;                                  *oo = wp->options;
                                   scope = OPTIONS_TABLE_PANE;
                           }
                         break;                          break;
                 }                  }
                 scope = OPTIONS_TABLE_WINDOW;                  scope = OPTIONS_TABLE_WINDOW;
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case OPTIONS_TABLE_WINDOW:          case OPTIONS_TABLE_WINDOW:
                 if (args_has(args, 'g'))                  if (args_has(args, 'g')) {
                         *oo = global_w_options;                          *oo = global_w_options;
                 else if (wl == NULL && target != NULL)                          scope = OPTIONS_TABLE_WINDOW;
                   } else if (wl == NULL && target != NULL)
                         xasprintf(cause, "no such window: %s", target);                          xasprintf(cause, "no such window: %s", target);
                 else if (wl == NULL)                  else if (wl == NULL)
                         xasprintf(cause, "no current window");                          xasprintf(cause, "no current window");
                 else                  else {
                         *oo = wl->window->options;                          *oo = wl->window->options;
                           scope = OPTIONS_TABLE_WINDOW;
                   }
                 break;                  break;
         }          }
         return (scope);          return (scope);

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51