diff --git a/SabreTools.Helper/Objects/Dat/DatFile.cs b/SabreTools.Helper/Objects/Dat/DatFile.cs index 8e1e487b..28ac15a7 100644 --- a/SabreTools.Helper/Objects/Dat/DatFile.cs +++ b/SabreTools.Helper/Objects/Dat/DatFile.cs @@ -2930,7 +2930,7 @@ namespace SabreTools.Helper // Handle MAME listxml since they're halfway between a SL and a Logiqx XML else if (line.StartsWith(" attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 3)); + Dictionary attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 2)); if (attribs.ContainsKey("build")) { @@ -2942,7 +2942,7 @@ namespace SabreTools.Helper // New software lists have this behavior else if (line.StartsWith(" attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 3)); + Dictionary attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 2)); if (attribs.ContainsKey("name")) { @@ -3002,7 +3002,7 @@ namespace SabreTools.Helper Name = (String.IsNullOrEmpty(Name) ? "M1" : Name); Description = (String.IsNullOrEmpty(Description) ? "M1" : Description); - Dictionary attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 3)); + Dictionary attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 2)); if (attribs.ContainsKey("version")) { @@ -3153,7 +3153,7 @@ namespace SabreTools.Helper if (line.StartsWith("flag")) { - Dictionary attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 3)); + Dictionary attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 2)); if (attribs.ContainsKey("name") && attribs.ContainsKey("value")) { @@ -3217,7 +3217,7 @@ namespace SabreTools.Helper bool isbios = false; // Get the game information - Dictionary gameattribs = GetLogiqxAttributes(line.Substring(1, line.Length - 3)); + Dictionary gameattribs = GetLogiqxAttributes(line.Substring(1, line.Length - 2)); string tempname = (gameattribs.ContainsKey("name") ? gameattribs["name"] : ""); string sourcefile = (gameattribs.ContainsKey("sourcefile") ? gameattribs["sourcefile"] : ""); @@ -3267,7 +3267,7 @@ namespace SabreTools.Helper // Now for the different file types else if (line.StartsWith(" attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 3)); + Dictionary attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 2)); Archive item = new Archive((attribs.ContainsKey("name") ? attribs["name"] : ""), tempname, @@ -3293,7 +3293,7 @@ namespace SabreTools.Helper } else if (line.StartsWith(" attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 3)); + Dictionary attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 2)); bool @default = false; if (attribs.ContainsKey("default")) @@ -3335,7 +3335,7 @@ namespace SabreTools.Helper } else if (line.StartsWith(" attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 3)); + Dictionary attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 2)); ItemStatus its = ItemStatus.None; if (attribs.ContainsKey("flags")) @@ -3433,7 +3433,7 @@ namespace SabreTools.Helper } else if (line.StartsWith(" attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 3)); + Dictionary attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 2)); bool @default = false; if (attribs.ContainsKey("default")) @@ -3477,7 +3477,7 @@ namespace SabreTools.Helper } else if (line.StartsWith(" attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 3)); + Dictionary attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 2)); ItemStatus its = ItemStatus.None; if (attribs.ContainsKey("flags")) @@ -3597,7 +3597,7 @@ namespace SabreTools.Helper } else if (line.StartsWith(" attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 3)); + Dictionary attribs = GetLogiqxAttributes(line.Substring(1, line.Length - 2)); Sample item = new Sample((attribs.ContainsKey("name") ? attribs["name"] : ""), tempname, @@ -3648,6 +3648,12 @@ namespace SabreTools.Helper { Dictionary attribs = new Dictionary(); + // If the line ends with a '/', remove it + if (line.EndsWith("/")) + { + line = line.TrimEnd('/'); + } + string[] gc = line.Trim().Split(' '); // Loop over all attributes and add them if possible