Changeset 2596 for vendor/gnumake/current/expand.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/expand.c
r1989 r2596 1 1 /* Variable expansion functions 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 … … 410 410 if (*p == '\0') 411 411 break; 412 else 413 412 413 ++p; 414 414 } 415 415 … … 443 443 expand_argument (const char *str, const char *end) 444 444 { 445 char *tmp; 445 char *tmp, *alloc = NULL; 446 char *r; 446 447 447 448 if (str == end) … … 451 452 return allocated_variable_expand (str); 452 453 453 tmp = alloca (end - str + 1); 454 if (end - str + 1 > 1000) 455 tmp = alloc = xmalloc (end - str + 1); 456 else 457 tmp = alloca (end - str + 1); 458 454 459 memcpy (tmp, str, end - str); 455 460 tmp[end - str] = '\0'; 456 461 457 return allocated_variable_expand (tmp); 462 r = allocated_variable_expand (tmp); 463 464 if (alloc) 465 free (alloc); 466 467 return r; 458 468 } 459 469 … … 570 580 value = variable_expand_for_file (line, file); 571 581 572 #if 0573 /* Waste a little memory and save time. */574 value = xrealloc (value, strlen (value))575 #endif576 577 582 variable_buffer = obuf; 578 583 variable_buffer_length = olen;
Note:
See TracChangeset
for help on using the changeset viewer.