summaryrefslogtreecommitdiff
path: root/function.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2009-06-13 21:21:48 +0000
committerPaul Smith <psmith@gnu.org>2009-06-13 21:21:48 +0000
commitbf9822658f50510d997da9d8c0c828dd7e26d6a6 (patch)
tree47ab9802e84026d85beb9e0b409872069bfb0e93 /function.c
parentc8840352acf40443a70ea3748130cee055154492 (diff)
downloadgunmake-bf9822658f50510d997da9d8c0c828dd7e26d6a6.tar.gz
- Fix Savannah bug 17825
- Fix Savannah bug 21231
Diffstat (limited to 'function.c')
-rw-r--r--function.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/function.c b/function.c
index 2ea1ac4..8c4a45d 100644
--- a/function.c
+++ b/function.c
@@ -361,7 +361,7 @@ string_glob (char *line)
That would break examples like:
$(patsubst ./%.c,obj/%.o,$(wildcard ./?*.c)). */
0),
- sizeof (struct nameseq));
+ sizeof (struct nameseq), 1);
if (result == 0)
{
@@ -372,26 +372,20 @@ string_glob (char *line)
idx = 0;
while (chain != 0)
{
- const char *name = chain->name;
- unsigned int len = strlen (name);
-
struct nameseq *next = chain->next;
+ unsigned int len = strlen (chain->name);
+
+ if (idx + len + 1 > length)
+ {
+ length += (len + 1) * 2;
+ result = xrealloc (result, length);
+ }
+ memcpy (&result[idx], chain->name, len);
+ idx += len;
+ result[idx++] = ' ';
+
free (chain);
chain = next;
-
- /* multi_glob will pass names without globbing metacharacters
- through as is, but we want only files that actually exist. */
- if (file_exists_p (name))
- {
- if (idx + len + 1 > length)
- {
- length += (len + 1) * 2;
- result = xrealloc (result, length);
- }
- memcpy (&result[idx], name, len);
- idx += len;
- result[idx++] = ' ';
- }
}
/* Kill the last space and terminate the string. */