[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.3 and 1.4

version 1.3, 1996/06/26 05:36:38 version 1.4, 1996/09/02 16:04:19
Line 1 
Line 1 
 /*      $OpenBSD$       */  /*      $OpenBSD$       */
 /*      $NetBSD: suff.c,v 1.11 1995/11/02 23:55:08 christos Exp $       */  /*      $NetBSD: suff.c,v 1.12 1996/08/13 16:42:16 christos Exp $       */
   
 /*  /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.   * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
Line 803 
Line 803 
     if (ln == NILLNODE) {      if (ln == NILLNODE) {
         s = (Suff *) emalloc (sizeof (Suff));          s = (Suff *) emalloc (sizeof (Suff));
   
         s->name =       strdup (str);          s->name =       estrdup (str);
         s->nameLen =    strlen (s->name);          s->nameLen =    strlen (s->name);
         s->searchPath = Lst_Init (FALSE);          s->searchPath = Lst_Init (FALSE);
         s->children =   Lst_Init (FALSE);          s->children =   Lst_Init (FALSE);
Line 1010 
Line 1010 
          * that...           * that...
          */           */
         s2 = (Src *) emalloc (sizeof (Src));          s2 = (Src *) emalloc (sizeof (Src));
         s2->file =      strdup(targ->pref);          s2->file =      estrdup(targ->pref);
         s2->pref =      targ->pref;          s2->pref =      targ->pref;
         s2->parent =    targ;          s2->parent =    targ;
         s2->node =      NILGNODE;          s2->node =      NILGNODE;
Line 1273 
Line 1273 
                      * again (ick)), and return the new structure.                       * again (ick)), and return the new structure.
                      */                       */
                     ret = (Src *)emalloc (sizeof (Src));                      ret = (Src *)emalloc (sizeof (Src));
                     ret->file = strdup(s->name);                      ret->file = estrdup(s->name);
                     ret->pref = targ->pref;                      ret->pref = targ->pref;
                     ret->suff = suff;                      ret->suff = suff;
                     suff->refCount++;                      suff->refCount++;
Line 1863 
Line 1863 
              * Allocate a Src structure to which things can be transformed               * Allocate a Src structure to which things can be transformed
              */               */
             targ = (Src *)emalloc(sizeof (Src));              targ = (Src *)emalloc(sizeof (Src));
             targ->file = strdup(gn->name);              targ->file = estrdup(gn->name);
             targ->suff = (Suff *)Lst_Datum(ln);              targ->suff = (Suff *)Lst_Datum(ln);
             targ->suff->refCount++;              targ->suff->refCount++;
             targ->node = gn;              targ->node = gn;
Line 1908 
Line 1908 
         }          }
   
         targ = (Src *)emalloc(sizeof (Src));          targ = (Src *)emalloc(sizeof (Src));
         targ->file = strdup(gn->name);          targ->file = estrdup(gn->name);
         targ->suff = suffNull;          targ->suff = suffNull;
         targ->suff->refCount++;          targ->suff->refCount++;
         targ->node = gn;          targ->node = gn;
         targ->parent = (Src *)NULL;          targ->parent = (Src *)NULL;
         targ->children = 0;          targ->children = 0;
         targ->pref = strdup(sopref);          targ->pref = estrdup(sopref);
 #ifdef DEBUG_SRC  #ifdef DEBUG_SRC
         targ->cp = Lst_Init(FALSE);          targ->cp = Lst_Init(FALSE);
 #endif  #endif
Line 2053 
Line 2053 
                 gn->suffix->refCount++;                  gn->suffix->refCount++;
             if (gn->path != NULL)              if (gn->path != NULL)
                 free(gn->path);                  free(gn->path);
             gn->path = strdup(gn->name);              gn->path = estrdup(gn->name);
         }          }
   
         goto sfnd_return;          goto sfnd_return;
Line 2154 
Line 2154 
      */       */
     if (gn->path)      if (gn->path)
         free(gn->path);          free(gn->path);
     gn->path = strdup(gn->name);      gn->path = estrdup(gn->name);
   
     /*      /*
      * Nuke the transformation path and the Src structures left over in the       * Nuke the transformation path and the Src structures left over in the
Line 2335 
Line 2335 
      */       */
     emptySuff = suffNull = (Suff *) emalloc (sizeof (Suff));      emptySuff = suffNull = (Suff *) emalloc (sizeof (Suff));
   
     suffNull->name =        strdup ("");      suffNull->name =        estrdup ("");
     suffNull->nameLen =     0;      suffNull->nameLen =     0;
     suffNull->searchPath =  Lst_Init (FALSE);      suffNull->searchPath =  Lst_Init (FALSE);
     Dir_Concat(suffNull->searchPath, dirSearchPath);      Dir_Concat(suffNull->searchPath, dirSearchPath);

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4