Skip to content

Commit

Permalink
Use resolve_home in dos module
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer committed May 6, 2023
1 parent c81ea9a commit ce75481
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/dos/program_boot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ FILE* BOOT::getFSFile(const char* filename, uint32_t* ksize, uint32_t* bsize,
if (tmpfile)
return tmpfile;
// File not found on mounted filesystem. Try regular filesystem
std::string filename_s(filename);
Cross::ResolveHomedir(filename_s);
const auto filename_s = resolve_home(filename).string();
tmpfile = fopen_wrap(filename_s.c_str(), "rb+");
if (!tmpfile) {
if ((tmpfile = fopen_wrap(filename_s.c_str(), "rb"))) {
Expand Down
6 changes: 2 additions & 4 deletions src/dos/program_imgmount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,7 @@ void IMGMOUNT::Run(void)
temp_line.c_str());
}
} else {
std::string home_resolve = temp_line;
Cross::ResolveHomedir(home_resolve);
const auto home_resolve = resolve_home(temp_line).string();
if (home_resolve == real_path) {
LOG_MSG("IMGMOUNT: Path '%s' found",
temp_line.c_str());
Expand All @@ -295,8 +294,7 @@ void IMGMOUNT::Run(void)
struct stat test;
if (stat(temp_line.c_str(), &test)) {
// See if it works if the ~ are written out
std::string homedir(temp_line);
Cross::ResolveHomedir(homedir);
const auto homedir = resolve_home(temp_line).string();
if (!stat(homedir.c_str(), &test)) {
temp_line = std::move(homedir);
} else {
Expand Down
3 changes: 1 addition & 2 deletions src/dos/program_mount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ void MOUNT::Run(void) {
if (real_path.empty()) {
LOG_MSG("MOUNT: Path '%s' not found", temp_line.c_str());
} else {
std::string home_resolve = temp_line;
Cross::ResolveHomedir(home_resolve);
const auto home_resolve = resolve_home(temp_line).string();
if (home_resolve == real_path) {
LOG_MSG("MOUNT: Path '%s' found",
temp_line.c_str());
Expand Down

0 comments on commit ce75481

Please sign in to comment.