Changeset 2591 for trunk/src/kmk/dir.c
- Timestamp:
- Jun 17, 2012, 10:45:31 PM (13 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk
- Property svn:ignore
-
old new 13 13 stamp-* 14 14 makebook* 15 15 16 .*gdbinit 17 .gdb_history 18 16 19 *.dep 17 20 *.dvi … … 31 34 *.pg 32 35 *.pgs 36 33 37 README 34 38 README.DOS 35 39 README.W32 40 README.OS2 36 41 aclocal.m4 37 42 autom4te.cache … … 52 57 config.h.W32 53 58 config.h-vms 59 54 60 loadavg 55 61 loadavg.c 56 62 make 63 57 64 .deps 58 65 .dep_segment 66 ID 67 TAGS 68 59 69 _* 60 70 sun4 … … 72 82 sol2 73 83 i486-linux 84 74 85 customs 86 75 87 install-sh 76 88 mkinstalldirs 89 90 .directive.asc
-
- Property svn:ignore
-
trunk/src/kmk/dir.c
r1993 r2591 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 … … 133 134 static PATH_VAR (new_filename); 134 135 char *df; 135 int i;136 136 137 137 if (filename == 0) … … 139 139 140 140 df = new_filename; 141 142 /* First, transform the name part. */143 141 while (*filename != '\0') 144 142 { … … 156 154 157 155 static int 158 vms_hash (c har *name)156 vms_hash (const char *name) 159 157 { 160 158 int h = 0; … … 182 180 /* fake stat entry for a directory */ 183 181 static int 184 vmsstat_dir (c har *name, struct stat *st)182 vmsstat_dir (const char *name, struct stat *st) 185 183 { 186 184 char *s; … … 195 193 if (s) 196 194 { 195 /* to keep the compiler happy we said "const char *name", now we cheat */ 197 196 *s++ = 0; 198 197 st->st_dev = (char *)vms_hash (name); … … 203 202 { 204 203 st->st_dev = 0; 205 s = name; 206 h = vms_hash (s); 204 h = vms_hash (name); 207 205 } 208 206 … … 496 494 #else 497 495 p = name + strlen (name); 496 # if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS) 497 dir_key.name = strcache_add_len (downcase(name), p - name); 498 # else 498 499 dir_key.name = strcache_add_len (name, p - name); 500 # endif 499 501 dir_slot = (struct directory **) hash_find_slot_strcached (&directories, &dir_key); 500 502 #endif … … 516 518 #endif 517 519 #ifndef CONFIG_WITH_STRCACHE2 520 #if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS) 521 dir->name = strcache_add_len (downcase(name), p - name); 522 #else 518 523 dir->name = strcache_add_len (name, p - name); 519 #else 524 #endif 525 #else /* CONFIG_WITH_STRCACHE2 */ 520 526 dir->name = dir_key.name; 521 #endif 527 #endif /* CONFIG_WITH_STRCACHE2 */ 522 528 hash_insert_at (&directories, dir, dir_slot); 523 529 /* The directory is not in the name hash table. … … 826 832 dirfile_slot = (struct dirfile **) hash_find_slot (&dir->dirfiles, &dirfile_key); 827 833 #else 834 # if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS) 835 dirfile_key.name = strcache_add_len (downcase(d->d_name), len); 836 # else 828 837 dirfile_key.name = strcache_add_len (d->d_name, len); 838 # endif 829 839 dirfile_key.length = len; 830 840 dirfile_slot = (struct dirfile **) hash_find_slot_strcached (&dir->dirfiles, &dirfile_key); … … 844 854 #endif 845 855 #ifndef CONFIG_WITH_STRCACHE2 856 #if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS) 857 df->name = strcache_add_len (downcase(d->d_name), len); 858 #else 846 859 df->name = strcache_add_len (d->d_name, len); 847 #else 860 #endif 861 #else /* CONFIG_WITH_STRCACHE2 */ 848 862 df->name = dirfile_key.name; 849 #endif 863 #endif /* CONFIG_WITH_STRCACHE2 */ 850 864 df->length = len; 851 865 df->impossible = 0; … … 854 868 /* Check if the name matches the one we're searching for. */ 855 869 #ifndef CONFIG_WITH_STRCACHE2 856 if (filename != 0 && strieq (d->d_name, filename))870 if (filename != 0 && patheq (d->d_name, filename)) 857 871 #else 858 872 if (filename != 0 && dirfile_key.name == filename) … … 1010 1024 1011 1025 if (dir->contents == 0) 1012 { 1013 /* The directory could not be stat'd. We allocate a contents 1014 structure for it, but leave it out of the contents hash table. */ 1026 /* The directory could not be stat'd. We allocate a contents 1027 structure for it, but leave it out of the contents hash table. */ 1015 1028 #ifndef CONFIG_WITH_ALLOC_CACHES 1016 dir->contents = xmalloc (sizeof (struct directory_contents)); 1017 #else 1018 dir->contents = alloccache_alloc (&directory_contents_cache); 1019 #endif 1020 memset (dir->contents, '\0', sizeof (struct directory_contents)); 1021 } 1029 dir->contents = xcalloc (sizeof (struct directory_contents)); 1030 #else 1031 dir->contents = alloccache_calloc (&directory_contents_cache); 1032 #endif 1022 1033 1023 1034 if (dir->contents->dirfiles.ht_vec == 0) … … 1040 1051 #endif 1041 1052 new->length = strlen (filename); 1053 #if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS) 1054 new->name = strcache_add_len (downcase(filename), new->length); 1055 #else 1042 1056 new->name = strcache_add_len (filename, new->length); 1057 #endif 1043 1058 new->impossible = 1; 1044 1059 #ifndef CONFIG_WITH_STRCACHE2
Note:
See TracChangeset
for help on using the changeset viewer.