Add dump_file_suffix to All_types.vcg filename
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Thu, 22 Aug 2002 10:28:52 +0000 (10:28 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Thu, 22 Aug 2002 10:28:52 +0000 (10:28 +0000)
[r460]

ir/ir/irdump.c

index 894f4f2..59d43cc 100644 (file)
@@ -955,7 +955,12 @@ void vcg_open_name (const char *name) {
   /** open file for vcg graph */
   len   = strlen(name);
   fname = malloc (len + 5);
+  if (dump_file_suffix)
+    fname = malloc (len + 5 + strlen(dump_file_suffix));
+  else
+    fname = malloc (len + 5);
   strcpy (fname, name);    /* copy the filename */
+  if (dump_file_suffix) strcat (fname, dump_file_suffix);
   strcat (fname, ".vcg");  /* append the .vcg suffix */
   F = fopen (fname, "w");  /* open file for writing */
   if (!F) {