We have a following code to find quote type:
if (isspace(S.front()) || isspace(S.back()))
Problem is that:
"int isspace( int ch ): The behavior is undefined if the value of
ch is not representable as unsigned char and is not equal to EOF."
(https://en.cppreference.com/w/cpp/string/byte/isspace)
This patch shows how this UB can be triggered and fixes an issue.
It looks like @rupprecht's comment (remove "do") here wasn't addressed prior to commit. I also want to suggest a couple of other minor improvements to the comment:
"Here we replace the section name..."
"We used to assert for..."