From: Weiwen Liu Date: Mon, 13 Jul 1998 22:54:48 +0000 (-0600) Subject: gcc.c (do_spec_1): Fix %O handling for secure temporary file creation. X-Git-Tag: prereleases/egcs-1.1-prerelease~262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24c2aa306882137cee93bc8871269008e58ff53d;p=thirdparty%2Fgcc.git gcc.c (do_spec_1): Fix %O handling for secure temporary file creation. 8 * gcc.c (do_spec_1): Fix %O handling for secure temporary file creation. From-SVN: r21124 --- diff --git a/gcc/gcc.c b/gcc/gcc.c index 17978f726445..4fbd7d000146 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -3610,10 +3610,21 @@ do_spec_1 (spec, inswitch, soft_matched_part) t->next = temp_names; temp_names = t; } - t->length = p - suffix; - t->suffix = save_string (suffix, p - suffix); - t->unique = (c != 'g'); - temp_filename = make_temp_file (suffix); + if (strncmp (suffix, "%O", 2) == 0) + { + t->length = strlen(OBJECT_SUFFIX); + t->suffix = save_string (OBJECT_SUFFIX, + strlen(OBJECT_SUFFIX)); + t->unique = (c != 'g'); + temp_filename = make_temp_file (OBJECT_SUFFIX); + } + else + { + t->length = p - suffix; + t->suffix = save_string (suffix, p - suffix); + t->unique = (c != 'g'); + temp_filename = make_temp_file (suffix); + } temp_filename_length = strlen (temp_filename); t->filename = temp_filename; t->filename_length = temp_filename_length;