mirror of
https://github.com/ppy/osu.git
synced 2025-02-05 17:43:00 +08:00
Don't trim whitespace from variable keys / values
This commit is contained in:
parent
b764d1bd04
commit
064a245c50
@ -130,14 +130,20 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected KeyValuePair<string, string> SplitKeyVal(string line, char separator = ':')
|
protected KeyValuePair<string, string> SplitKeyVal(string line, char separator = ':', bool shouldTrim = true)
|
||||||
{
|
{
|
||||||
string[] split = line.Split(separator, 2);
|
string[] split = line.Split(separator, 2);
|
||||||
|
|
||||||
|
if (shouldTrim)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < split.Length; i++)
|
||||||
|
split[i] = split[i].Trim();
|
||||||
|
}
|
||||||
|
|
||||||
return new KeyValuePair<string, string>
|
return new KeyValuePair<string, string>
|
||||||
(
|
(
|
||||||
split[0].Trim(),
|
split[0],
|
||||||
split.Length > 1 ? split[1].Trim() : string.Empty
|
split.Length > 1 ? split[1] : string.Empty
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
private void handleVariables(string line)
|
private void handleVariables(string line)
|
||||||
{
|
{
|
||||||
var pair = SplitKeyVal(line, '=');
|
var pair = SplitKeyVal(line, '=', false);
|
||||||
variables[pair.Key] = pair.Value;
|
variables[pair.Key] = pair.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user