LogicAndTrick / sledge-formats

C# parsers and formats for Half-Life 1 and related engines.
MIT License
71 stars 10 forks source link

Incorrect handling of // in serialized objects #6

Closed 13xforever closed 2 years ago

13xforever commented 2 years ago

Right now SerializedObjectFormatter.CleanLine() truncates anything after // token even if it's inside a valid string (such as URL). It should be only removed if it's outside the string or the sole content of the line.

Example:

"web"
{
    "WebFav0_URL"       "https://www.google.com/"
    "WebFav0_Name"      "Google"
}
LogicAndTrick commented 2 years ago

Thanks for the report, it should be fixed now in 1.0.3. I rewrote the parser, but the tests still pass so hopefully it doesn't break compatibility.