Fix '#' being stripped in INI file password field

Bug report by Sheridan in #151
This commit is contained in:
ORelio 2016-05-12 22:20:06 +02:00
parent 5e6f4d3af9
commit f37bd96ff9

View file

@ -136,7 +136,10 @@ namespace MinecraftClient
ParseMode pMode = ParseMode.Default;
foreach (string lineRAW in Lines)
{
string line = lineRAW.Split('#')[0].Trim();
string line = pMode == ParseMode.Main && lineRAW.ToLower().Trim().StartsWith("password")
? lineRAW.Trim() //Do not strip # in passwords
: lineRAW.Split('#')[0].Trim();
if (line.Length > 0)
{
if (line[0] == '[' && line[line.Length - 1] == ']')