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

Diff for /src/usr.bin/tmux/arguments.c between version 1.26 and 1.27

version 1.26, 2019/06/20 07:10:56 version 1.27, 2019/07/09 14:03:12
Line 38 
Line 38 
 struct args_entry {  struct args_entry {
         u_char                   flag;          u_char                   flag;
         struct args_values       values;          struct args_values       values;
           u_int                    count;
         RB_ENTRY(args_entry)     entry;          RB_ENTRY(args_entry)     entry;
 };  };
   
Line 174 
Line 175 
         size_t                   len;          size_t                   len;
         char                    *buf;          char                    *buf;
         int                      i;          int                      i;
           u_int                    j;
         struct args_entry       *entry;          struct args_entry       *entry;
         struct args_value       *value;          struct args_value       *value;
   
Line 187 
Line 189 
   
                 if (*buf == '\0')                  if (*buf == '\0')
                         args_print_add(&buf, &len, "-");                          args_print_add(&buf, &len, "-");
                 args_print_add(&buf, &len, "%c", entry->flag);                  for (j = 0; j < entry->count; j++)
                           args_print_add(&buf, &len, "%c", entry->flag);
         }          }
   
         /* Then the flags with arguments. */          /* Then the flags with arguments. */
Line 244 
Line 247 
 int  int
 args_has(struct args *args, u_char ch)  args_has(struct args *args, u_char ch)
 {  {
         return (args_find(args, ch) != NULL);          struct args_entry       *entry;
   
           entry = args_find(args, ch);
           if (entry == NULL)
                   return (0);
           return (entry->count);
 }  }
   
 /* Set argument value in the arguments tree. */  /* Set argument value in the arguments tree. */
Line 258 
Line 266 
         if (entry == NULL) {          if (entry == NULL) {
                 entry = xcalloc(1, sizeof *entry);                  entry = xcalloc(1, sizeof *entry);
                 entry->flag = ch;                  entry->flag = ch;
                   entry->count = 1;
                 TAILQ_INIT(&entry->values);                  TAILQ_INIT(&entry->values);
                 RB_INSERT(args_tree, &args->tree, entry);                  RB_INSERT(args_tree, &args->tree, entry);
         }          } else
                   entry->count++;
   
         if (s != NULL) {          if (s != NULL) {
                 value = xcalloc(1, sizeof *value);                  value = xcalloc(1, sizeof *value);

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27