mirror of
https://github.com/neovim/neovim.git
synced 2026-09-26 07:18:29 +00:00
Problem: too many strlen() calls
Solution: Change expand_env() to return string length
(John Marriott)
This commit does the following changes:
- In expand_env_esc():
- return the length of the returned dst string.
- refactor to remove some calls to STRLEN() and STRCAT()
- add check for out-of-memory condition.
- Change call sites in various source files to use the return value
closes: vim/vim#17561
https://github.com/vim/vim/commit/fff0132399082b7d012d0c1291cf0c6c99e200ff
Co-authored-by: John Marriott <basilisk@internode.on.net>