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/ar.c

    r1989 r2596  
    11/* Interface to `ar' archives 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.
     5
    56This file is part of GNU Make.
    67
     
    2526#include <fnmatch.h>
    2627
    27 /* Return nonzero if NAME is an archive-member reference, zero if not.
    28    An archive-member reference is a name like `lib(member)'.
     28/* Return nonzero if NAME is an archive-member reference, zero if not.  An
     29   archive-member reference is a name like `lib(member)' where member is a
     30   non-empty string.
    2931   If a name like `lib((entry))' is used, a fatal error is signaled at
    3032   the attempt to use this unsupported feature.  */
     
    4042
    4143  end = p + strlen (p) - 1;
    42   if (*end != ')')
     44  if (*end != ')' || end == p + 1)
    4345    return 0;
    4446
     
    199201    {
    200202      /* We have a match.  Add it to the chain.  */
    201       struct nameseq *new = xmalloc (state->size);
    202       memset (new, '\0', state->size);
    203       new->name = strcache_add (concat (state->arname, mem, ")"));
     203      struct nameseq *new = xcalloc (state->size);
     204      new->name = strcache_add (concat (4, state->arname, "(", mem, ")"));
    204205      new->next = state->chain;
    205206      state->chain = new;
     
    216217{
    217218  const char *p;
    218   int open = 0;
     219  int opened = 0;
    219220
    220221  for (p = pattern; *p != '\0'; ++p)
     
    231232
    232233      case '[':
    233         open = 1;
     234        opened = 1;
    234235        break;
    235236
    236237      case ']':
    237         if (open)
     238        if (opened)
    238239          return 1;
    239240        break;
     
    252253  struct nameseq *n;
    253254  const char **names;
    254   char *name;
    255255  unsigned int i;
    256256
     
    260260  /* Scan the archive for matches.
    261261     ar_glob_match will accumulate them in STATE.chain.  */
    262   i = strlen (arname);
    263   name = alloca (i + 2);
    264   memcpy (name, arname, i);
    265   name[i] = '(';
    266   name[i + 1] = '\0';
    267   state.arname = name;
     262  state.arname = arname;
    268263  state.pattern = member_pattern;
    269264  state.size = size;
     
    282277
    283278  /* Sort them alphabetically.  */
    284   qsort (names, i, sizeof (*names), alpha_compare);
     279  /* MSVC erroneously warns without a cast here.  */
     280  qsort ((void *)names, i, sizeof (*names), alpha_compare);
    285281
    286282  /* Put them back into the chain in the sorted order.  */
Note: See TracChangeset for help on using the changeset viewer.