summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1993-06-04 19:53:32 +0000
committerRoland McGrath <roland@redhat.com>1993-06-04 19:53:32 +0000
commit074d147ef77e287a15b82b7d661d9e530e81bc4a (patch)
tree1e2523a1f386aedc65416777fa43363487aca030
parent55f5d979aee1b92cd953bb7b51467407495b57e2 (diff)
downloadgunmake-074d147ef77e287a15b82b7d661d9e530e81bc4a.tar.gz
Formerly main.c.~87~
-rw-r--r--main.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/main.c b/main.c
index 2c22d2e..fe731c7 100644
--- a/main.c
+++ b/main.c
@@ -712,8 +712,11 @@ main (argc, argv, envp)
/* Replace the name that read_all_makefiles will
see with the name of the temporary file. */
{
- makefiles->list[i] = (char *) alloca (sizeof (name));
- bcopy (name, makefiles->list[i], sizeof (name));
+ char *temp;
+ /* SGI compiler requires alloca's result be assigned simply. */
+ temp = (char *) alloca (sizeof (name));
+ bcopy (name, temp, sizeof (name));
+ makefiles->list[i] = temp;
}
/* Make sure the temporary file will not be remade. */
@@ -1436,8 +1439,10 @@ decode_env_switches (envar, len)
return;
/* Make a copy of the value in ARGS, where we will munge it.
- If it does not begin with a dash, prepend one. */
- args = (char *) alloca (1 + len + 2);
+ If it does not begin with a dash, prepend one.
+ We must allocate lasting storage for this (and we never free it) because
+ decode_switches may save pointers into it for string-valued switches. */
+ args = (char *) xmalloc (1 + len + 2);
if (value[0] != '-')
args[0] = '-';
bcopy (value, value[0] == '-' ? args : &args[1], len + 1);