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

A possible bug in full_split ? #29

Open
chetmurthy opened this issue Sep 2, 2023 · 0 comments
Open

A possible bug in full_split ? #29

chetmurthy opened this issue Sep 2, 2023 · 0 comments

Comments

@chetmurthy
Copy link

Over at the OCaml discussion forum, someone found what looks like a bug with full_split: https://discuss.ocaml.org/t/full-split-in-pcre/12948/1

TL;DR it looks like full_split isn't getting unmatched groups right for delimiters after the first delimiter. I dug into the code, and it seems like the problem might be with the way that full_split invokes unsafe_pcre_exec. To wit, everywhere else except in the split functions (full_split, internal_psplit) the value of subj_start is always 0. But in these two functions, it is the same as pos.

When I changed this to 0, the bug evinced in the post above disappeared.

I'm going to dig further, but I thought I'd report this, and ask for your feedback. If you're still actively maintaining this code, I'll send a PR; otherwise, I'll just fix it in the pcre2 codebase.

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

1 participant