- Add xcalloc() and call it

- Fix memory errors found by valgrind
- Remove multi_glob() and empower parse_file_seq() to do its job:
  the goal here is to remove the confusing reverse/re-reverse we do on
  the file lists: needed for future fixes.
- Add a prefix arg to parse_file_seq()
- Make concat() variadic so it can take arbitrary #'s of strings
This commit is contained in:
Paul Smith
2009-09-16 17:07:01 +00:00
parent 5abe477620
commit 8f30b68871
17 changed files with 434 additions and 424 deletions

View File

@@ -979,7 +979,7 @@ target_environment (struct file *file)
strcmp(v->name, "PATH") == 0)
convert_Path_to_windows32(value, ';');
#endif
*result++ = xstrdup (concat (v->name, "=", value));
*result++ = xstrdup (concat (3, v->name, "=", value));
free (value);
}
else
@@ -989,7 +989,7 @@ target_environment (struct file *file)
strcmp(v->name, "PATH") == 0)
convert_Path_to_windows32(v->value, ';');
#endif
*result++ = xstrdup (concat (v->name, "=", v->value));
*result++ = xstrdup (concat (3, v->name, "=", v->value));
}
}
@@ -1324,7 +1324,10 @@ parse_variable_definition (const char *p, enum variable_flavor *flavor)
{
wspace = 1;
p = next_token (p);
c = *p++;
c = *p;
if (c == '\0')
return NULL;
++p;
}
@@ -1333,8 +1336,9 @@ parse_variable_definition (const char *p, enum variable_flavor *flavor)
*flavor = f_recursive;
return (char *)p;
}
/* Match assignment variants (:=, +=, ?=) */
else if (*p == '=')
if (*p == '=')
{
switch (c)
{
@@ -1592,7 +1596,7 @@ sync_Path_environment (void)
* Create something WINDOWS32 world can grok
*/
convert_Path_to_windows32 (path, ';');
environ_path = xstrdup (concat ("PATH", "=", path));
environ_path = xstrdup (concat (3, "PATH", "=", path));
putenv (environ_path);
free (path);
}