]> gcc.gnu.org Git - gcc.git/commitdiff
gcc.c (do_spec_1): Fix %O handling for secure temporary file creation.
authorWeiwen Liu <weiwen.liu@yale.edu>
Mon, 13 Jul 1998 22:54:48 +0000 (16:54 -0600)
committerJeff Law <law@gcc.gnu.org>
Mon, 13 Jul 1998 22:54:48 +0000 (16:54 -0600)
8
        * gcc.c (do_spec_1): Fix %O handling for secure temporary file
        creation.

From-SVN: r21124

gcc/gcc.c

index 17978f726445ffa17b15f41e7ee64f80268c1585..4fbd7d000146e9331aaf6d2f0ba72f23230698a2 100644 (file)
--- 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;
This page took 0.06977 seconds and 5 git commands to generate.