mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
[Imgtool] Fixed a recently introduced error in the 'dir' command line command
This commit is contained in:
parent
2f9ef59017
commit
a68a72a7f7
@ -179,7 +179,7 @@ static int cmd_dir(const struct command *c, int argc, char *argv[])
|
|||||||
imgtool_dirent ent;
|
imgtool_dirent ent;
|
||||||
char buf[512];
|
char buf[512];
|
||||||
char last_modified[19];
|
char last_modified[19];
|
||||||
const char *path;
|
std::string path;
|
||||||
int partition_index = 0;
|
int partition_index = 0;
|
||||||
std::string info;
|
std::string info;
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ static int cmd_dir(const struct command *c, int argc, char *argv[])
|
|||||||
if (err)
|
if (err)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
path = argc > 2 ? argv[2] : nullptr;
|
path = argc > 2 ? argv[2] : "";
|
||||||
|
|
||||||
err = imgtool::directory::open(*partition, path, imgenum);
|
err = imgtool::directory::open(*partition, path, imgenum);
|
||||||
if (err)
|
if (err)
|
||||||
@ -204,7 +204,7 @@ static int cmd_dir(const struct command *c, int argc, char *argv[])
|
|||||||
total_count = 0;
|
total_count = 0;
|
||||||
total_size = 0;
|
total_size = 0;
|
||||||
|
|
||||||
fprintf(stdout, "Contents of %s:%s\n", argv[1], path ? path : "");
|
fprintf(stdout, "Contents of %s:%s\n", argv[1], path.c_str());
|
||||||
|
|
||||||
info = image->info();
|
info = image->info();
|
||||||
if (!info.empty())
|
if (!info.empty())
|
||||||
|
Loading…
Reference in New Issue
Block a user