[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.15 and 1.16

version 1.15, 2010/12/13 22:53:14 version 1.16, 2012/07/10 11:53:01
Line 87 
Line 87 
                         buf = xrealloc(buf, 1, len + strlen(t) + 1);                          buf = xrealloc(buf, 1, len + strlen(t) + 1);
                         strlcpy(buf + len, t, strlen(t) + 1);                          strlcpy(buf + len, t, strlen(t) + 1);
                         len += strlen(t);                          len += strlen(t);
                         xfree(t);                          free(t);
                         break;                          break;
                 case '"':                  case '"':
                         if ((t = cmd_string_string(s, &p, '"', 1)) == NULL)                          if ((t = cmd_string_string(s, &p, '"', 1)) == NULL)
Line 95 
Line 95 
                         buf = xrealloc(buf, 1, len + strlen(t) + 1);                          buf = xrealloc(buf, 1, len + strlen(t) + 1);
                         strlcpy(buf + len, t, strlen(t) + 1);                          strlcpy(buf + len, t, strlen(t) + 1);
                         len += strlen(t);                          len += strlen(t);
                         xfree(t);                          free(t);
                         break;                          break;
                 case '$':                  case '$':
                         if ((t = cmd_string_variable(s, &p)) == NULL)                          if ((t = cmd_string_variable(s, &p)) == NULL)
Line 103 
Line 103 
                         buf = xrealloc(buf, 1, len + strlen(t) + 1);                          buf = xrealloc(buf, 1, len + strlen(t) + 1);
                         strlcpy(buf + len, t, strlen(t) + 1);                          strlcpy(buf + len, t, strlen(t) + 1);
                         len += strlen(t);                          len += strlen(t);
                         xfree(t);                          free(t);
                         break;                          break;
                 case '#':                  case '#':
                         /* Comment: discard rest of line. */                          /* Comment: discard rest of line. */
Line 152 
Line 152 
                                 buf = xrealloc(buf, 1, len + strlen(t) + 1);                                  buf = xrealloc(buf, 1, len + strlen(t) + 1);
                                 strlcpy(buf + len, t, strlen(t) + 1);                                  strlcpy(buf + len, t, strlen(t) + 1);
                                 len += strlen(t);                                  len += strlen(t);
                                 xfree(t);                                  free(t);
                                 break;                                  break;
                         }                          }
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
Line 170 
Line 170 
         xasprintf(cause, "invalid or unknown command: %s", s);          xasprintf(cause, "invalid or unknown command: %s", s);
   
 out:  out:
         if (buf != NULL)          free(buf);
                 xfree(buf);  
   
         if (argv != NULL) {          if (argv != NULL) {
                 for (i = 0; i < argc; i++)                  for (i = 0; i < argc; i++)
                         xfree(argv[i]);                          free(argv[i]);
                 xfree(argv);                  free(argv);
         }          }
   
         return (rval);          return (rval);
Line 224 
Line 223 
                         buf = xrealloc(buf, 1, len + strlen(t) + 1);                          buf = xrealloc(buf, 1, len + strlen(t) + 1);
                         strlcpy(buf + len, t, strlen(t) + 1);                          strlcpy(buf + len, t, strlen(t) + 1);
                         len += strlen(t);                          len += strlen(t);
                         xfree(t);                          free(t);
                         continue;                          continue;
                 }                  }
   
Line 239 
Line 238 
         return (buf);          return (buf);
   
 error:  error:
         if (buf != NULL)          free(buf);
                 xfree(buf);  
         return (NULL);          return (NULL);
 }  }
   
Line 303 
Line 301 
         buf[len] = '\0';          buf[len] = '\0';
   
         envent = environ_find(&global_environ, buf);          envent = environ_find(&global_environ, buf);
         xfree(buf);          free(buf);
         if (envent == NULL)          if (envent == NULL)
                 return (xstrdup(""));                  return (xstrdup(""));
         return (xstrdup(envent->value));          return (xstrdup(envent->value));
   
 error:  error:
         if (buf != NULL)          free(buf);
                 xfree(buf);  
         return (NULL);          return (NULL);
 }  }
   
Line 334 
Line 331 
                         return (NULL);                          return (NULL);
                 if ((pw = getpwnam(username)) != NULL)                  if ((pw = getpwnam(username)) != NULL)
                         home = pw->pw_dir;                          home = pw->pw_dir;
                 xfree(username);                  free(username);
         }          }
         if (home == NULL)          if (home == NULL)
                 return (NULL);                  return (NULL);

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16