EricZimmerman / Registry

Full featured, offline Registry parser in C#
MIT License
220 stars 52 forks source link

string.IndexOf() requires a StringComparison #4

Closed Genbox closed 6 years ago

Genbox commented 7 years ago

On this line: https://github.com/EricZimmerman/Registry/blob/master/Registry/Cells/VKCellRecord.cs#L413 StringComparison.Ordinal is missing. This becomes apparent when running on Linux since string.IndexOf has different behavior due to the different interpretation of strings.

The IndexOf() in the code above returns "0" on Linux and "-1" on Windows. Adding StringComparison.Ordinal makes the comparison encoding independent.

EricZimmerman commented 6 years ago

This is fixed and will be in the next release