Previous 15994 Revisions Next

r1472 Tuesday 1st January, 2008 at 00:10:31 UTC by Nathan Woods
[Windows Imgtool] Fixed a bug that could cause filenames to get mangled when
inserting files onto images with a directory structure. (bug #1458)
[docs]messnew.txt
[src/mess/tools/imgtool/windows]wimgtool.c

src/mess/tools/imgtool/windows/wimgtool.c
r1471r1472
12161216   /* figure out the image filename */
12171217   s1 = strrchr(ofn.filename, '\\');
12181218   s1 = s1 ? s1 + 1 : ofn.filename;
1219   image_filename = mame_strdup(s1);
1219   image_filename = (char *) alloca(strlen(s1) + 1);
1220   strcpy(image_filename, s1);
12201221
1221   if (info->current_directory)
1222   /* append the current directory, if appropriate */
1223   if (info->current_directory != NULL)
12221224   {
12231225      s2 = (char *) alloca(strlen(info->current_directory) + strlen(image_filename) + 1);
12241226      strcpy(s2, info->current_directory);
12251227      strcat(s2, image_filename);
1226      free(image_filename);
1227      image_filename = mame_strdup(image_filename);
1228      image_filename = s2;
12281229   }
12291230
12301231   err = imgtool_partition_write_file(info->partition, image_filename, fork, stream, opts, filter);
r1471r1472
12361237      goto done;
12371238
12381239done:
1239   if (image_filename)
1240      free(image_filename);
1241   if (opts)
1240   if (opts != NULL)
12421241      option_resolution_close(opts);
12431242   if (err)
12441243      wimgtool_report_error(window, err, image_filename, ofn.filename);
docs/messnew.txt
r1471r1472
2020
2121Imgtool Changes:
2222----------------
23(none)
23- [Windows Imgtool] Fixed a bug that could cause filenames to get mangled when
24  inserting files onto images with a directory structure.  (bug #1458) [Nate
25  Woods]
2426
2527
2628

Previous 15994 Revisions Next


© 1998-2018 The MESS Team