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

Diff for /src/usr.bin/make/dir.c between version 1.4 and 1.5

version 1.4, 1996/06/26 05:36:29 version 1.5, 1996/09/02 16:04:09
Line 1 
Line 1 
 /*      $OpenBSD$       */  /*      $OpenBSD$       */
 /*      $NetBSD: dir.c,v 1.10 1996/02/04 22:20:38 christos Exp $        */  /*      $NetBSD: dir.c,v 1.11 1996/08/13 16:42:02 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 355 
Line 355 
              (pattern[0] == '.')))               (pattern[0] == '.')))
         {          {
             (void)Lst_AtEnd(expansions,              (void)Lst_AtEnd(expansions,
                             (isDot ? strdup(entry->name) :                              (isDot ? estrdup(entry->name) :
                              str_concat(p->name, entry->name,                               str_concat(p->name, entry->name,
                                         STR_ADDSLASH)));                                          STR_ADDSLASH)));
         }          }
Line 707 
Line 707 
             }              }
             hits += 1;              hits += 1;
             dot->hits += 1;              dot->hits += 1;
             return (strdup (name));              return (estrdup (name));
     }      }
   
     if (Lst_Open (path) == FAILURE) {      if (Lst_Open (path) == FAILURE) {
Line 818 
Line 818 
                 /*                  /*
                  * Checking in dot -- DON'T put a leading ./ on the thing.                   * Checking in dot -- DON'T put a leading ./ on the thing.
                  */                   */
                 file = strdup(name);                  file = estrdup(name);
                 checkedDot = TRUE;                  checkedDot = TRUE;
             }              }
             if (DEBUG(DIR)) {              if (DEBUG(DIR)) {
Line 914 
Line 914 
     }      }
   
     if (Hash_FindEntry (&p->files, cp) != (Hash_Entry *)NULL) {      if (Hash_FindEntry (&p->files, cp) != (Hash_Entry *)NULL) {
         return (strdup (name));          return (estrdup (name));
     } else {      } else {
         return ((char *) NULL);          return ((char *) NULL);
     }      }
Line 929 
Line 929 
         if (DEBUG(DIR)) {          if (DEBUG(DIR)) {
             printf("got it (in mtime cache)\n");              printf("got it (in mtime cache)\n");
         }          }
         return(strdup(name));          return(estrdup(name));
     } else if (stat (name, &stb) == 0) {      } else if (stat (name, &stb) == 0) {
         entry = Hash_CreateEntry(&mtimes, name, (Boolean *)NULL);          entry = Hash_CreateEntry(&mtimes, name, (Boolean *)NULL);
         if (DEBUG(DIR)) {          if (DEBUG(DIR)) {
Line 937 
Line 937 
                     name);                      name);
         }          }
         Hash_SetValue(entry, (long)stb.st_mtime);          Hash_SetValue(entry, (long)stb.st_mtime);
         return (strdup (name));          return (estrdup (name));
     } else {      } else {
         if (DEBUG(DIR)) {          if (DEBUG(DIR)) {
             printf("failed. Returning NULL\n");              printf("failed. Returning NULL\n");
Line 980 
Line 980 
     }      }
   
     if (fullName == (char *)NULL) {      if (fullName == (char *)NULL) {
         fullName = strdup(gn->name);          fullName = estrdup(gn->name);
     }      }
   
     entry = Hash_FindEntry(&mtimes, fullName);      entry = Hash_FindEntry(&mtimes, fullName);
Line 1054 
Line 1054 
   
         if ((d = opendir (name)) != (DIR *) NULL) {          if ((d = opendir (name)) != (DIR *) NULL) {
             p = (Path *) emalloc (sizeof (Path));              p = (Path *) emalloc (sizeof (Path));
             p->name = strdup (name);              p->name = estrdup (name);
             p->hits = 0;              p->hits = 0;
             p->refCount = 1;              p->refCount = 1;
             Hash_InitTable (&p->files, -1);              Hash_InitTable (&p->files, -1);
Line 1138 
Line 1138 
     LstNode       ln;     /* the node of the current directory */      LstNode       ln;     /* the node of the current directory */
     Path          *p;     /* the structure describing the current directory */      Path          *p;     /* the structure describing the current directory */
   
     str = strdup ("");      str = estrdup ("");
   
     if (Lst_Open (path) == SUCCESS) {      if (Lst_Open (path) == SUCCESS) {
         while ((ln = Lst_Next (path)) != NILLNODE) {          while ((ln = Lst_Next (path)) != NILLNODE) {

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