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

Diff for /src/usr.bin/make/varmodifiers.c between version 1.39 and 1.40

version 1.39, 2014/09/21 13:43:25 version 1.40, 2015/01/23 13:18:40
Line 391 
Line 391 
 static bool  static bool
 VarUniq(struct Name *word, bool addSpace, Buffer buf, void *lastp)  VarUniq(struct Name *word, bool addSpace, Buffer buf, void *lastp)
 {  {
         struct Name *last = (struct Name *)lastp;          struct Name *last = lastp;
   
         /* does not match */          /* does not match */
         if (last->s == NULL || last->e - last->s != word->e - word->s ||          if (last->s == NULL || last->e - last->s != word->e - word->s ||
Line 409 
Line 409 
 static bool  static bool
 VarLoop(struct Name *word, bool addSpace, Buffer buf, void *vp)  VarLoop(struct Name *word, bool addSpace, Buffer buf, void *vp)
 {  {
         struct LoopStuff *v = (struct LoopStuff *)vp;          struct LoopStuff *v = vp;
   
         if (addSpace)          if (addSpace)
                 Buf_AddSpace(buf);                  Buf_AddSpace(buf);
Line 420 
Line 420 
 static char *  static char *
 finish_loop(const char *s, const struct Name *n UNUSED , void *p)  finish_loop(const char *s, const struct Name *n UNUSED , void *p)
 {  {
         struct LoopStuff *l = (struct LoopStuff *)p;          struct LoopStuff *l = p;
   
         return Var_Subst(s, NULL,  l->err);          return Var_Subst(s, NULL,  l->err);
 }  }
Line 514 
Line 514 
 static char *  static char *
 do_def(const char *s, const struct Name *n UNUSED, void *arg)  do_def(const char *s, const struct Name *n UNUSED, void *arg)
 {  {
         VarPattern *v = (VarPattern *)arg;          VarPattern *v = arg;
         if (s == NULL) {          if (s == NULL) {
                 free_patternarg(v);                  free_patternarg(v);
                 return NULL;                  return NULL;
Line 525 
Line 525 
 static char *  static char *
 do_undef(const char *s, const struct Name *n UNUSED, void *arg)  do_undef(const char *s, const struct Name *n UNUSED, void *arg)
 {  {
         VarPattern *v = (VarPattern *)arg;          VarPattern *v = arg;
         if (s != NULL) {          if (s != NULL) {
                 free_patternarg(v);                  free_patternarg(v);
                 return NULL;                  return NULL;
Line 536 
Line 536 
 static char *  static char *
 do_assign(const char *s, const struct Name *n, void *arg)  do_assign(const char *s, const struct Name *n, void *arg)
 {  {
         VarPattern *v = (VarPattern *)arg;          VarPattern *v = arg;
         char *msg;          char *msg;
         char *result;          char *result;
   
Line 570 
Line 570 
 static char *  static char *
 do_exec(const char *s UNUSED, const struct Name *n UNUSED, void *arg)  do_exec(const char *s UNUSED, const struct Name *n UNUSED, void *arg)
 {  {
         VarPattern *v = (VarPattern *)arg;          VarPattern *v = arg;
         char *msg;          char *msg;
         char *result;          char *result;
   
Line 592 
Line 592 
 {  {
         size_t  len;          size_t  len;
         const char      *ptr;          const char      *ptr;
         VarPattern      *pat = (VarPattern *)patp;          VarPattern      *pat = patp;
   
         if (*word->s != '\0') {          if (*word->s != '\0') {
                 if (addSpace)                  if (addSpace)
Line 682 
Line 682 
 {  {
     size_t      wordLen;    /* Length of word */      size_t      wordLen;    /* Length of word */
     const char  *cp;        /* General pointer */      const char  *cp;        /* General pointer */
     VarPattern  *pattern = (VarPattern *)patternp;      VarPattern  *pattern = patternp;
   
     wordLen = word->e - word->s;      wordLen = word->e - word->s;
     if ((pattern->flags & (VAR_SUB_ONE|VAR_SUB_MATCHED)) !=      if ((pattern->flags & (VAR_SUB_ONE|VAR_SUB_MATCHED)) !=
Line 1072 
Line 1072 
 static char *  static char *
 VarQuote(const char *str, const struct Name *n UNUSED, void *islistp)  VarQuote(const char *str, const struct Name *n UNUSED, void *islistp)
 {  {
         int islist = *((int *)islistp);          int *p = islistp;
           int islist = *p;
   
         BUFFER    buf;          BUFFER    buf;
         /* This should cover most shells :-( */          /* This should cover most shells :-( */
Line 1224 
Line 1225 
 static void  static void
 free_looparg(void *arg)  free_looparg(void *arg)
 {  {
         struct LoopStuff *l = (struct LoopStuff *)arg;          struct LoopStuff *l = arg;
   
         Var_DeleteLoopVar(l->var);          Var_DeleteLoopVar(l->var);
         free(l->expand);          free(l->expand);
Line 1388 
Line 1389 
 static void  static void
 free_patternarg(void *p)  free_patternarg(void *p)
 {  {
         VarPattern *vp = (VarPattern *)p;          VarPattern *vp = p;
   
         free(vp->lbuffer);          free(vp->lbuffer);
         free(vp->rhs);          free(vp->rhs);
Line 1400 
Line 1401 
 do_regex(const char *s, const struct Name *n UNUSED, void *arg)  do_regex(const char *s, const struct Name *n UNUSED, void *arg)
 {  {
         VarREPattern p2;          VarREPattern p2;
         VarPattern *p = (VarPattern *)arg;          VarPattern *p = arg;
         int error;          int error;
         char *result;          char *result;
   

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40