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

Diff for /src/usr.bin/make/suff.c between version 1.66 and 1.67

version 1.66, 2007/09/17 09:16:58 version 1.67, 2007/09/17 09:28:36
Line 310 
Line 310 
 static int  static int
 SuffSuffIsPrefix(void *s, const void *str)  SuffSuffIsPrefix(void *s, const void *str)
 {  {
         return SuffStrIsPrefix(((Suff *)s)->name,          return SuffStrIsPrefix(((Suff *)s)->name,
             (const char *)str) == NULL ? 1 : 0;              (const char *)str) == NULL ? 1 : 0;
 }  }
   
Line 463 
Line 463 
                 if (srcLn == NULL)                  if (srcLn == NULL)
                         srcLn = Lst_FindConst(&sufflist, SuffSuffIsPrefix, str);                          srcLn = Lst_FindConst(&sufflist, SuffSuffIsPrefix, str);
                 else                  else
                         srcLn = Lst_FindFromConst(Lst_Succ(srcLn),                          srcLn = Lst_FindFromConst(Lst_Succ(srcLn),
                             SuffSuffIsPrefix, str);                              SuffSuffIsPrefix, str);
                 if (srcLn == NULL) {                  if (srcLn == NULL) {
                         /*                          /*
Line 1037 
Line 1037 
                         break;                          break;
                 }                  }
   
                 if ((ptr = Dir_FindFile(s->file, &s->suff->searchPath))                  if ((ptr = Dir_FindFile(s->file, &s->suff->searchPath))
                     != NULL) {                      != NULL) {
                         rs = s;                          rs = s;
 #ifdef DEBUG_SRC  #ifdef DEBUG_SRC
Line 1116 
Line 1116 
                                  */                                   */
                                 suff = (Suff *)Lst_Datum(ln2);                                  suff = (Suff *)Lst_Datum(ln2);
   
                                 if (Lst_Member(&suff->parents, targ->suff)                                  if (Lst_Member(&suff->parents, targ->suff)
                                     != NULL) {                                      != NULL) {
                                         /*                                          /*
                                          * Hot Damn! Create a new Src structure                                           * Hot Damn! Create a new Src structure
Line 1404 
Line 1404 
         gn = (GNode *)Lst_Datum(ln);          gn = (GNode *)Lst_Datum(ln);
   
         if (DEBUG(SUFF))          if (DEBUG(SUFF))
                 printf("\tapplying %s -> %s to \"%s\"\n", s->name, t->name,                  printf("\tapplying %s -> %s to \"%s\"\n", s->name, t->name,
                     tGn->name);                      tGn->name);
   
         /* Record last child for expansion purposes.  */          /* Record last child for expansion purposes.  */
Line 1692 
Line 1692 
                  * the node is only a source (not on the lhs of a dependency                   * the node is only a source (not on the lhs of a dependency
                  * operator or [XXX] it has neither children or commands).  */                   * operator or [XXX] it has neither children or commands).  */
                 if (OP_NOP(gn->type) ||                  if (OP_NOP(gn->type) ||
                     (Lst_IsEmpty(&gn->children) &&                      (Lst_IsEmpty(&gn->children) &&
                     Lst_IsEmpty(&gn->commands))) {                      Lst_IsEmpty(&gn->commands))) {
                         gn->path = Dir_FindFile(gn->name,                          gn->path = Dir_FindFile(gn->name,
                             (targ == NULL ? defaultPath :                              (targ == NULL ? defaultPath :
Line 1705 
Line 1705 
                                         /* Suffix known for the thing -- trim                                          /* Suffix known for the thing -- trim
                                          * the suffix off the path to form the                                           * the suffix off the path to form the
                                          * proper .PREFIX variable.  */                                           * proper .PREFIX variable.  */
                                         int savep = strlen(gn->path) -                                          int savep = strlen(gn->path) -
                                             targ->suff->nameLen;                                              targ->suff->nameLen;
                                         char savec;                                          char savec;
   
Line 1714 
Line 1714 
                                         savec = gn->path[savep];                                          savec = gn->path[savep];
                                         gn->path[savep] = '\0';                                          gn->path[savep] = '\0';
   
                                         if ((ptr = strrchr(gn->path, '/'))                                          if ((ptr = strrchr(gn->path, '/'))
                                             != NULL)                                              != NULL)
                                                 ptr++;                                                  ptr++;
                                         else                                          else
Line 1728 
Line 1728 
                                          * the target has no known suffix.  */                                           * the target has no known suffix.  */
                                         gn->suffix = NULL;                                          gn->suffix = NULL;
   
                                         if ((ptr = strrchr(gn->path, '/'))                                          if ((ptr = strrchr(gn->path, '/'))
                                             != NULL)                                              != NULL)
                                                 ptr++;                                                  ptr++;
                                         else                                          else
Line 1797 
Line 1797 
                         targ->node = Targ_FindNode(targ->file, TARG_CREATE);                          targ->node = Targ_FindNode(targ->file, TARG_CREATE);
                 }                  }
   
                 SuffApplyTransform(targ->node, src->node, targ->suff,                  SuffApplyTransform(targ->node, src->node, targ->suff,
                     src->suff);                      src->suff);
   
                 if (targ->node != gn) {                  if (targ->node != gn) {
Line 1950 
Line 1950 
                  */                   */
                 suffNull = s;                  suffNull = s;
         } else {          } else {
                 Parse_Error(PARSE_WARNING,                  Parse_Error(PARSE_WARNING,
                     "Desired null suffix %s not defined.", name);                      "Desired null suffix %s not defined.", name);
         }          }
 }  }

Legend:
Removed from v.1.66  
changed lines
  Added in v.1.67