[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.40 and 1.41

version 1.40, 2015/01/23 13:18:40 version 1.41, 2015/01/23 22:35:58
Line 356 
Line 356 
 VarMatch(struct Name *word, bool addSpace, Buffer buf,  VarMatch(struct Name *word, bool addSpace, Buffer buf,
     void *pattern) /* Pattern the word must match */      void *pattern) /* Pattern the word must match */
 {  {
         const char *pat = (const char *)pattern;          const char *pat = pattern;
   
         if (Str_Matchi(word->s, word->e, pat, strchr(pat, '\0'))) {          if (Str_Matchi(word->s, word->e, pat, strchr(pat, '\0'))) {
                 if (addSpace)                  if (addSpace)
Line 377 
Line 377 
 VarNoMatch(struct Name *word, bool addSpace, Buffer buf,  VarNoMatch(struct Name *word, bool addSpace, Buffer buf,
     void *pattern) /* Pattern the word must not match */      void *pattern) /* Pattern the word must not match */
 {  {
         const char *pat = (const char *)pattern;          const char *pat = pattern;
   
         if (!Str_Matchi(word->s, word->e, pat, strchr(pat, '\0'))) {          if (!Str_Matchi(word->s, word->e, pat, strchr(pat, '\0'))) {
                 if (addSpace)                  if (addSpace)
Line 428 
Line 428 
 static int  static int
 NameCompare(const void *ap, const void *bp)  NameCompare(const void *ap, const void *bp)
 {  {
         struct Name *a, *b;          const struct Name *a, *b;
         size_t n, m;          size_t n, m;
         int c;          int c;
   
         a = (struct Name *)ap;          a = ap;
         b = (struct Name *)bp;          b = bp;
         n = a->e - a->s;          n = a->e - a->s;
         m = b->e - b->s;          m = b->e - b->s;
         if (n < m) {          if (n < m) {
                 c = strncmp(a->s, b->s, n);                  c = strncmp(a->s, b->s, n);
                 if (c != 0)                  if (c != 0)
                     return c;                          return c;
                 else                  else
                     return -1;                          return -1;
         } else if (m < n) {          } else if (m < n) {
                 c = strncmp(a->s, b->s, m);                  c = strncmp(a->s, b->s, m);
                 if (c != 0)                  if (c != 0)
                     return c;                          return c;
                 else                  else
                     return 1;                          return 1;
         } else          } else
             return strncmp(a->s, b->s, n);                  return strncmp(a->s, b->s, n);
 }  }
   
 static char *  static char *

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