Changeset 2591 for trunk/src/kmk/expand.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/expand.c
r2548 r2591 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 … … 539 539 if (*p == '\0') 540 540 break; 541 else 542 541 542 ++p; 543 543 } 544 544 … … 845 845 { 846 846 #ifndef CONFIG_WITH_VALUE_LENGTH 847 char *tmp; 847 char *tmp, *alloc = NULL; 848 char *r; 848 849 #endif 849 850 … … 855 856 return allocated_variable_expand (str); 856 857 857 tmp = alloca (end - str + 1); 858 if (end - str + 1 > 1000) 859 tmp = alloc = xmalloc (end - str + 1); 860 else 861 tmp = alloca (end - str + 1); 862 858 863 memcpy (tmp, str, end - str); 859 864 tmp[end - str] = '\0'; 860 865 861 return allocated_variable_expand (tmp); 866 r = allocated_variable_expand (tmp); 867 868 if (alloc) 869 free (alloc); 870 871 return r; 862 872 #else /* CONFIG_WITH_VALUE_LENGTH */ 863 873 if (!end) … … 1103 1113 value = variable_expand_for_file (line, file); 1104 1114 1105 #if 01106 /* Waste a little memory and save time. */1107 value = xrealloc (value, strlen (value))1108 #endif1109 1110 1115 variable_buffer = obuf; 1111 1116 variable_buffer_length = olen;
Note:
See TracChangeset
for help on using the changeset viewer.