aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 50be2f8..cec9954 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3387,9 +3387,11 @@ process_command (argc, argv)
if (! IS_DIR_SEPARATOR (value [len - 1])
&& is_directory (value, "", 0))
{
- value = strcpy (xmalloc (len + 2), value);
- value[len] = DIR_SEPARATOR;
- value[++ len] = 0;
+ char *tmp = xmalloc (len + 2);
+ strcpy (tmp, value);
+ tmp[len] = DIR_SEPARATOR;
+ tmp[++ len] = 0;
+ value = tmp;
}
/* As a kludge, if the arg is "[foo/]stageN/", just