Unix slashes in file path when using Mono

Bug report by MousePak
This commit is contained in:
ORelio 2014-06-27 13:26:27 +02:00
parent 2907b9c587
commit 608eb8059c
2 changed files with 10 additions and 9 deletions

View file

@ -33,15 +33,16 @@ namespace MinecraftClient.ChatBots
public static bool lookForScript(ref string filename)
{
//Automatically look in subfolders and try to add ".txt" file extension
char dir_slash = Program.isUsingMono ? '/' : '\\';
string[] files = new string[]
{
filename,
filename + ".txt",
"scripts\\" + filename,
"scripts\\" + filename + ".txt",
"config\\" + filename,
"config\\" + filename + ".txt",
};
{
filename,
filename + ".txt",
"scripts" + dir_slash + filename,
"scripts" + dir_slash + filename + ".txt",
"config" + dir_slash + filename,
"config" + dir_slash + filename + ".txt",
};
foreach (string possible_file in files)
{