Skip to content

Commit

Permalink
Fix slashes for DOSBox data_dirs (tkashkin#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkashkin committed Jul 6, 2019
1 parent 2f7c584 commit ff9270b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/data/compat/DOSBox.vala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace GameHub.Data.Compat

var data_path = ProjectConfig.PROJECT_NAME + "/compat/dosbox";

string[] data_dirs = { ProjectConfig.DATADIR };
string[] data_dirs = { FSUtils.file(ProjectConfig.DATADIR, data_path).get_path() };
var user_data_dir = Environment.get_user_data_dir();
var system_data_dirs = Environment.get_system_data_dirs();

Expand All @@ -64,7 +64,8 @@ namespace GameHub.Data.Compat

if(user_data_dir != null && user_data_dir.length > 0)
{
if(!(user_data_dir in data_dirs)) data_dirs += user_data_dir;
var dir = FSUtils.file(user_data_dir, data_path).get_path();
if(!(dir in data_dirs)) data_dirs += dir;
}

if(system_data_dirs != null && system_data_dirs.length > 0)
Expand All @@ -75,7 +76,8 @@ namespace GameHub.Data.Compat
{
debug("[DOSBox.init] system_data_dir: '%s'", system_data_dir);
}
if(!(system_data_dir in data_dirs)) data_dirs += system_data_dir;
var dir = FSUtils.file(system_data_dir, data_path).get_path();
if(!(dir in data_dirs)) data_dirs += dir;
}
}

Expand All @@ -86,7 +88,7 @@ namespace GameHub.Data.Compat

foreach(var dir in data_dirs)
{
var data_dir = FSUtils.file(dir, data_path);
var data_dir = FSUtils.file(dir);
if(data_dir == null || !data_dir.query_exists()) continue;

if(GameHub.Application.log_verbose)
Expand Down

0 comments on commit ff9270b

Please sign in to comment.