From 3ae7de4ed745c3a4ac764131c491f9a92ba76404 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sun, 3 Jan 1993 07:28:19 -0500 Subject: [PATCH] (putenv_from_prefixes): Use PATH_SEPARATOR. Properly use JUST_MACHINE_SUFFIX when desired; always make path the same as find_a_file will use. From-SVN: r3065 --- gcc/gcc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gcc/gcc.c b/gcc/gcc.c index 39a897881cc..2f21fcb7aec 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -1215,6 +1215,8 @@ putenv_from_prefixes (paths, env_var) char *env_var; { int suffix_len = (machine_suffix) ? strlen (machine_suffix) : 0; + int just_suffix_len + = (just_machine_suffix) ? strlen (just_machine_suffix) : 0; int first_time = TRUE; struct prefix_list *pprefix; @@ -1227,7 +1229,7 @@ putenv_from_prefixes (paths, env_var) if (machine_suffix) { if (!first_time) - obstack_grow (&collect_obstack, ":", 1); + obstack_1grow (&collect_obstack, PATH_SEPARATOR); first_time = FALSE; obstack_grow (&collect_obstack, pprefix->prefix, len); @@ -1237,23 +1239,24 @@ putenv_from_prefixes (paths, env_var) if (just_machine_suffix && pprefix->require_machine_suffix == 2) { if (!first_time) - obstack_grow (&collect_obstack, ":", 1); + obstack_1grow (&collect_obstack, PATH_SEPARATOR); first_time = FALSE; obstack_grow (&collect_obstack, pprefix->prefix, len); - obstack_grow (&collect_obstack, machine_suffix, suffix_len); + obstack_grow (&collect_obstack, just_machine_suffix, + just_suffix_len); } if (!pprefix->require_machine_suffix) { if (!first_time) - obstack_grow (&collect_obstack, ":", 1); + obstack_1grow (&collect_obstack, PATH_SEPARATOR); first_time = FALSE; obstack_grow (&collect_obstack, pprefix->prefix, len); } } - obstack_grow (&collect_obstack, "\0", 1); + obstack_1grow (&collect_obstack, '\0'); putenv (obstack_finish (&collect_obstack)); } -- 2.30.2