Changeset 2596 for vendor/gnumake/current/dir.c
- Timestamp:
- Jun 20, 2012, 12:44:52 AM (13 years ago)
- Location:
- vendor/gnumake/current
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current
- Property svn:ignore deleted
-
vendor/gnumake/current/dir.c
r1989 r2596 1 1 /* Directory hashing for GNU Make. 2 2 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software4 Foundation, Inc.3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 4 2010 Free Software Foundation, Inc. 5 5 This file is part of GNU Make. 6 6 … … 24 24 # define NAMLEN(dirent) strlen((dirent)->d_name) 25 25 # ifdef VMS 26 char *vmsify (char *name, int type); 26 /* its prototype is in vmsdir.h, which is not needed for HAVE_DIRENT_H */ 27 const char *vmsify (const char *name, int type); 27 28 # endif 28 29 #else … … 124 125 static PATH_VAR (new_filename); 125 126 char *df; 126 int i;127 127 128 128 if (filename == 0) … … 130 130 131 131 df = new_filename; 132 133 /* First, transform the name part. */134 132 while (*filename != '\0') 135 133 { … … 147 145 148 146 static int 149 vms_hash (c har *name)147 vms_hash (const char *name) 150 148 { 151 149 int h = 0; … … 173 171 /* fake stat entry for a directory */ 174 172 static int 175 vmsstat_dir (c har *name, struct stat *st)173 vmsstat_dir (const char *name, struct stat *st) 176 174 { 177 175 char *s; … … 186 184 if (s) 187 185 { 186 /* to keep the compiler happy we said "const char *name", now we cheat */ 188 187 *s++ = 0; 189 188 st->st_dev = (char *)vms_hash (name); … … 194 193 { 195 194 st->st_dev = 0; 196 s = name; 197 h = vms_hash (s); 195 h = vms_hash (name); 198 196 } 199 197 … … 453 451 p = name + strlen (name); 454 452 dir = xmalloc (sizeof (struct directory)); 453 #if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS) 454 dir->name = strcache_add_len (downcase(name), p - name); 455 #else 455 456 dir->name = strcache_add_len (name, p - name); 457 #endif 456 458 hash_insert_at (&directories, dir, dir_slot); 457 459 /* The directory is not in the name hash table. … … 711 713 { 712 714 df = xmalloc (sizeof (struct dirfile)); 715 #if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS) 716 df->name = strcache_add_len (downcase(d->d_name), len); 717 #else 713 718 df->name = strcache_add_len (d->d_name, len); 719 #endif 714 720 df->length = len; 715 721 df->impossible = 0; … … 717 723 } 718 724 /* Check if the name matches the one we're searching for. */ 719 if (filename != 0 && strieq (d->d_name, filename))725 if (filename != 0 && patheq (d->d_name, filename)) 720 726 return 1; 721 727 } … … 870 876 871 877 if (dir->contents == 0) 872 { 873 /* The directory could not be stat'd. We allocate a contents 874 structure for it, but leave it out of the contents hash table. */ 875 dir->contents = xmalloc (sizeof (struct directory_contents)); 876 memset (dir->contents, '\0', sizeof (struct directory_contents)); 877 } 878 /* The directory could not be stat'd. We allocate a contents 879 structure for it, but leave it out of the contents hash table. */ 880 dir->contents = xcalloc (sizeof (struct directory_contents)); 878 881 879 882 if (dir->contents->dirfiles.ht_vec == 0) … … 887 890 new = xmalloc (sizeof (struct dirfile)); 888 891 new->length = strlen (filename); 892 #if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS) 893 new->name = strcache_add_len (downcase(filename), new->length); 894 #else 889 895 new->name = strcache_add_len (filename, new->length); 896 #endif 890 897 new->impossible = 1; 891 898 hash_insert (&dir->contents->dirfiles, new);
Note:
See TracChangeset
for help on using the changeset viewer.