Ignore:
Timestamp:
Jun 20, 2012, 12:44:52 AM (13 years ago)
Author:
bird
Message:

gnumake/current -> 3.82-cvs.

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  
    11/* Directory hashing for GNU Make.
    22Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
    3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
    4 Foundation, Inc.
     31998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
     42010 Free Software Foundation, Inc.
    55This file is part of GNU Make.
    66
     
    2424# define NAMLEN(dirent) strlen((dirent)->d_name)
    2525# ifdef VMS
    26 char *vmsify (char *name, int type);
     26/* its prototype is in vmsdir.h, which is not needed for HAVE_DIRENT_H */
     27const char *vmsify (const char *name, int type);
    2728# endif
    2829#else
     
    124125  static PATH_VAR (new_filename);
    125126  char *df;
    126   int i;
    127127
    128128  if (filename == 0)
     
    130130
    131131  df = new_filename;
    132 
    133   /* First, transform the name part.  */
    134132  while (*filename != '\0')
    135133    {
     
    147145
    148146static int
    149 vms_hash (char *name)
     147vms_hash (const char *name)
    150148{
    151149  int h = 0;
     
    173171/* fake stat entry for a directory */
    174172static int
    175 vmsstat_dir (char *name, struct stat *st)
     173vmsstat_dir (const char *name, struct stat *st)
    176174{
    177175  char *s;
     
    186184  if (s)
    187185    {
     186      /* to keep the compiler happy we said "const char *name", now we cheat */
    188187      *s++ = 0;
    189188      st->st_dev = (char *)vms_hash (name);
     
    194193    {
    195194      st->st_dev = 0;
    196       s = name;
    197       h = vms_hash (s);
     195      h = vms_hash (name);
    198196    }
    199197
     
    453451      p = name + strlen (name);
    454452      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
    455456      dir->name = strcache_add_len (name, p - name);
     457#endif
    456458      hash_insert_at (&directories, dir, dir_slot);
    457459      /* The directory is not in the name hash table.
     
    711713        {
    712714          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
    713718          df->name = strcache_add_len (d->d_name, len);
     719#endif
    714720          df->length = len;
    715721          df->impossible = 0;
     
    717723        }
    718724      /* 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))
    720726        return 1;
    721727    }
     
    870876
    871877  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));
    878881
    879882  if (dir->contents->dirfiles.ht_vec == 0)
     
    887890  new = xmalloc (sizeof (struct dirfile));
    888891  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
    889895  new->name = strcache_add_len (filename, new->length);
     896#endif
    890897  new->impossible = 1;
    891898  hash_insert (&dir->contents->dirfiles, new);
Note: See TracChangeset for help on using the changeset viewer.