Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan fails when using double newlines #116

Closed
Jonathan-Greve opened this issue Jun 6, 2024 · 1 comment
Closed

Scan fails when using double newlines #116

Jonathan-Greve opened this issue Jun 6, 2024 · 1 comment

Comments

@Jonathan-Greve
Copy link

Jonathan-Greve commented Jun 6, 2024

Hi loving the library!

I have a minor issue with scanning some strings.

This doesn't scan succesfully:
auto scan_result = scn::scan<int>("0\n\n", "{}\n\n");

similarly these won't either:
auto scan_result = scn::scan<int>("0\n\r", "{}\n\r");
auto scan_result = scn::scan<int>("0\r\n", "{}\r\n");
auto scan_result = scn::scan<int>("0\r\r", "{}\r\r");

These will scan succesfully:
auto scan_result = scn::scan<int>("0\r\r", "{}");
auto scan_result = scn::scan<int>("0\r\r", "{}\0\n"); (I also don't understand why this is successful since "\r\r" != "\0\n"

Reproduced here:
https://godbolt.org/z/YY6K7Tzch

The results error message is: "Unexpected end of source"

Could you please offer some insight on what is happening here?

@eliaskosunen
Copy link
Owner

This is a bug, fixed in 58ae085. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants