What happens is that if the content is (ignore single quotes): 'hell o\'.
The fss extended content conversion should be (include double quotes): "hell o\\".
The code must realize that the last \ is a would end up before a quote, or one would get: "hell o\".
That content string would then be classified as an unterminated group.
input->start++;
} // while
- if (input->start > input->stop || input->start >= content.used) {
- break;
- }
-
- if (content.string[input->start] == quoted) {
+ if (content.string[input->start] == quoted || input->start > input->stop || input->start >= content.used) {
pre_allocate_size += slash_count + 1;
if (pre_allocate_size > buffer->size) {
slash_count--;
} // while
+ if (input->start > input->stop || input->start >= content.used) {
+ break;
+ }
+
buffer->string[buffer_position.stop] = f_fss_delimit_slash;
buffer->string[buffer_position.stop + 1] = quoted;
buffer_position.stop += 2;