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

Adding checks to ends_with and starts_with to prevent failure #295

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MartorSkull
Copy link

Fixing cases where part is longer than string, this cases should both return false instead of failing.

E.g.:

ends_with("asdf", "0123456789");

fails with

E: runtime error: Character index 4294967290 out of range of string 'asdf' with length 4.

but it should simply return false.

This should be merged together with a fix to the builtin substr function to throw an error if the desired substring does not fit inside the string.

Fixing cases where part is longer than string, this cases should both return false instead of failing.
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

Successfully merging this pull request may close these issues.

1 participant