From 8572d6adf04d397505770b0b0d5cfd91cf6a92a8 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 8 Jul 2002 02:26:47 +0000 Subject: Major updates in preparation for 3.80. New version of the manual, put into the doc subdir. Enhancements: $(eval ...) and $(value ...) functions, various bug fixes, etc. See the ChangeLog. More to come. --- implicit.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'implicit.c') diff --git a/implicit.c b/implicit.c index cce1795..05eaa7f 100644 --- a/implicit.c +++ b/implicit.c @@ -100,7 +100,7 @@ pattern_search (file, archive, depth, recursions) /* List of dependencies found recursively. */ struct file **intermediate_files - = (struct file **) alloca (max_pattern_deps * sizeof (struct file *)); + = (struct file **) xmalloc (max_pattern_deps * sizeof (struct file *)); /* List of the patterns used to find intermediate files. */ char **intermediate_patterns @@ -121,8 +121,8 @@ pattern_search (file, archive, depth, recursions) /* Buffer in which we store all the rules that are possibly applicable. */ struct rule **tryrules - = (struct rule **) alloca (num_pattern_rules * max_pattern_targets - * sizeof (struct rule *)); + = (struct rule **) xmalloc (num_pattern_rules * max_pattern_targets + * sizeof (struct rule *)); /* Number of valid elements in TRYRULES. */ unsigned int nrules; @@ -495,7 +495,7 @@ pattern_search (file, archive, depth, recursions) /* RULE is nil if the loop went all the way through the list and everything failed. */ if (rule == 0) - return 0; + goto done; foundrule = i; @@ -624,6 +624,9 @@ pattern_search (file, archive, depth, recursions) file->also_make = new; } + done: + free (intermediate_files); + free (tryrules); - return 1; + return rule != 0; } -- cgit v1.2.3