commit - b2e4bb0d39e67e9bd19a21781919ae1fe6af4d71
commit + f189f149ec12a46aba134fffd4f6a2037936f775
blob - af686781ce24358a1c645c3393dc823af6e6ef2f
blob + 3494a1ee27a939370511b000898abcb8ef4b5f1d
--- make/make.c
+++ make/make.c
{
str_reset ();
expand_into (sc, s, target, deps);
- return str_copy ();
+ return str_get ();
}
char *
char *args[] = {
m_shell.value,
"-c",
- expand (sc, cmd, NULL, NULL),
+ strdup (expand (sc, cmd, NULL, NULL)),
NULL,
};
ssize_t i, n;
}
+ free (args[2]);
str_chomp ();
return str_copy ();
*t = '\0';
/* parse deps */
- u = expand (sc, t + 1, NULL, NULL);
+ u = strdup (trim (expand (sc, t + 1, NULL, NULL)));
for (p = strtok (u, " \t"); p != NULL; p = strtok (NULL, " \t")) {
dep = new (struct dep);
dep->next = NULL;
free (u);
/* parse targets */
- u = expand (sc, s, NULL, NULL);
+ u = strdup (trim (expand (sc, s, NULL, NULL)));
flag = 1;
if (u[0] == '.') {
p = strchr (u + 1, '.');
++cmd;
}
- cmd = expand (sc, cmd, target, deps);
+ cmd = strdup (expand (sc, cmd, target, deps));
if (!q)
printf ("[%s] $ %s\n", path_to_str (prefix), cmd);