Changeset 2591 for trunk/src/kmk/ar.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/ar.c
r1993 r2591 1 1 /* Interface to `ar' archives 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 Software 4 Foundation, Inc. 3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 4 2010 Free Software Foundation, Inc. 5 5 6 This file is part of GNU Make. 6 7 … … 25 26 #include <fnmatch.h> 26 27 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. 29 31 If a name like `lib((entry))' is used, a fatal error is signaled at 30 32 the attempt to use this unsupported feature. */ … … 40 42 41 43 end = p + strlen (p) - 1; 42 if (*end != ')' )44 if (*end != ')' || end == p + 1) 43 45 return 0; 44 46 … … 199 201 { 200 202 /* 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, ")")); 204 205 new->next = state->chain; 205 206 state->chain = new; … … 216 217 { 217 218 const char *p; 218 int open = 0;219 int opened = 0; 219 220 220 221 for (p = pattern; *p != '\0'; ++p) … … 231 232 232 233 case '[': 233 open = 1;234 opened = 1; 234 235 break; 235 236 236 237 case ']': 237 if (open )238 if (opened) 238 239 return 1; 239 240 break; … … 252 253 struct nameseq *n; 253 254 const char **names; 254 char *name;255 255 unsigned int i; 256 256 … … 260 260 /* Scan the archive for matches. 261 261 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; 268 263 state.pattern = member_pattern; 269 264 state.size = size; … … 282 277 283 278 /* 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); 285 281 286 282 /* Put them back into the chain in the sorted order. */
Note:
See TracChangeset
for help on using the changeset viewer.