This commit fixes a few problems introduced by the last Scintilla update. That update caused some headache around the incompatible changes to `SCI_GETTEXT`, `SCI_GETSELTEXT`, and `SCI_GETCURLINE`.
- An explicit NUL termination was added to `sci_get_text()`. This is both superflous and wrong (it writes behind the allocated buffer) as SCI_GETTEXT already does NUL termination.
- In `sci_get_contents()`, sci_get_string() cannot be used. That would call SCI_GETTEXT with length == 0 which is not the desired outcome. Instead, basically revert to the old implementation but account for the API change.
- The callers of sci_get_selected_text_length() must be adapted, this was missing yet. sci_get_selected_text_length() return value does not include the NUL termination anymore.
Resolves #3095
Fixes: d7c985e47 ("Adapt to SCI_GETTEXT changes") You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3098
-- Commit Summary --
* Scintilla 5.1.5 aftermath
-- File Changes --
M src/sciwrappers.c (20) M src/ui_utils.c (4)
-- Patch Links --
https://github.com/geany/geany/pull/3098.patch https://github.com/geany/geany/pull/3098.diff
Just went through the patch and looks good to me. This should be basically all needed for Geany itself.
Thanks. I'll merge quickly as it resolves pretty severe issue.
Merged #3098 into master.
Thanks. I'll merge quickly as it resolves pretty severe issue.
Pity. What a pleasant change to see that Geany is capable of crashing ;-).
github-comments@lists.geany.org