WindowsInternals icon indicating copy to clipboard operation
WindowsInternals copied to clipboard

[UwpList] handling caps.txt line feed encoding

Open sirotnikov opened this issue 6 years ago • 0 comments

in UwpList.cpp in BuildCapabilityMap string name(caps, cr - 1); assumes \r\n line feed but after getting sources, it was \n only.

Thus string name(caps, cr-1); creates a truncated string, as cr points at the last string char, and not one past it.

I suggest adding if (*(cr - 1) == '\r') cr--; and then string name(caps, cr); to be line feed agnostic.

this also makes sense with if (*cr == '\r') cr++; later, as it can't be both \n and '\r'.

sirotnikov avatar Nov 04 '18 16:11 sirotnikov