Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@silnem2
Copy link
Contributor

@silnem2 silnem2 commented Jan 15, 2024

This PR addresses an off-by-one error in wrd:offset. Previously, if M-c were used on a non-alphanumeric character and there were no alphanumeric characters between the position of the cursor and the end of the buffer, wrd:offset would increment its counter to a value one greater than the remaining length of the buffer. As a result, this +snag call in /lib/sole would fail due to its using an out-of-bounds index, causing Dojo to crash and unlink:

%del [%ins p.ted (snag p.ted buf)]

This fix corrects the issue by modifying wrd to check if the next character is null (i.e. the end of the buffer) and if so to return the current value of the counter rather than incrementing, preventing the off-by-one error and resultant crash.

Resolves #6864

@pkova pkova merged commit 3903983 into urbit:develop Jan 30, 2024
@silnem2 silnem2 deleted the drum-crash branch January 30, 2024 13:12
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.

M-c on some characters wipes the dojo history

2 participants