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

Diff for /src/usr.bin/tmux/Attic/cmd-string.c between version 1.24 and 1.25

version 1.24, 2016/10/14 22:14:22 version 1.25, 2017/01/15 22:00:56
Line 54 
Line 54 
         (*p)--;          (*p)--;
 }  }
   
 /*  struct cmd_list *
  * Parse command string. Returns -1 on error. If returning -1, cause is error  cmd_string_parse(const char *s, const char *file, u_int line, char **cause)
  * string, or NULL for empty command.  
  */  
 int  
 cmd_string_parse(const char *s, struct cmd_list **cmdlist, const char *file,  
     u_int line, char **cause)  
 {  {
         size_t          p;          size_t            p = 0;
         int             ch, i, argc, rval;          int               ch, i, argc = 0;
         char          **argv, *buf, *t;          char            **argv = NULL, *buf = NULL, *t;
         const char     *whitespace, *equals;          const char       *whitespace, *equals;
         size_t          len;          size_t            len = 0;
           struct cmd_list  *cmdlist = NULL;
   
         argv = NULL;  
         argc = 0;  
   
         buf = NULL;  
         len = 0;  
   
         *cause = NULL;          *cause = NULL;
   
         *cmdlist = NULL;  
         rval = -1;  
   
         p = 0;  
         for (;;) {          for (;;) {
                 ch = cmd_string_getc(s, &p);                  ch = cmd_string_getc(s, &p);
                 switch (ch) {                  switch (ch) {
Line 133 
Line 118 
                         if (argc == 0)                          if (argc == 0)
                                 goto out;                                  goto out;
   
                         *cmdlist = cmd_list_parse(argc, argv, file, line,                          cmdlist = cmd_list_parse(argc, argv, file, line, cause);
                             cause);  
                         if (*cmdlist == NULL)  
                                 goto out;  
   
                         rval = 0;  
                         goto out;                          goto out;
                 case '~':                  case '~':
                         if (buf == NULL) {                          if (buf == NULL) {
Line 171 
Line 151 
                 free(argv);                  free(argv);
         }          }
   
         return (rval);          return (cmdlist);
 }  }
   
 static void  static void

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25