[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.2 and 1.3

version 1.2, 2009/06/04 23:34:32 version 1.3, 2009/07/07 21:23:22
Line 105 
Line 105 
         const struct cmd_entry **entryp, *entry;          const struct cmd_entry **entryp, *entry;
         struct cmd              *cmd;          struct cmd              *cmd;
         char                     s[BUFSIZ];          char                     s[BUFSIZ];
         int                      opt;          int                      opt, ambiguous = 0;
   
         *cause = NULL;          *cause = NULL;
         if (argc == 0) {          if (argc == 0) {
Line 117 
Line 117 
         for (entryp = cmd_table; *entryp != NULL; entryp++) {          for (entryp = cmd_table; *entryp != NULL; entryp++) {
                 if ((*entryp)->alias != NULL &&                  if ((*entryp)->alias != NULL &&
                     strcmp((*entryp)->alias, argv[0]) == 0) {                      strcmp((*entryp)->alias, argv[0]) == 0) {
                           ambiguous = 0;
                         entry = *entryp;                          entry = *entryp;
                         break;                          break;
                 }                  }
Line 124 
Line 125 
                 if (strncmp((*entryp)->name, argv[0], strlen(argv[0])) != 0)                  if (strncmp((*entryp)->name, argv[0], strlen(argv[0])) != 0)
                         continue;                          continue;
                 if (entry != NULL)                  if (entry != NULL)
                         goto ambiguous;                          ambiguous = 1;
                 entry = *entryp;                  entry = *entryp;
   
                 /* Bail now if an exact match. */                  /* Bail now if an exact match. */
                 if (strcmp(entry->name, argv[0]) == 0)                  if (strcmp(entry->name, argv[0]) == 0)
                         break;                          break;
         }          }
           if (ambiguous)
                   goto ambiguous;
         if (entry == NULL) {          if (entry == NULL) {
                 xasprintf(cause, "unknown command: %s", argv[0]);                  xasprintf(cause, "unknown command: %s", argv[0]);
                 return (NULL);                  return (NULL);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3