]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.1467: too many strlen() calls v9.1.1467
authorJohn Marriott <basilisk@internode.on.net>
Wed, 18 Jun 2025 16:15:31 +0000 (18:15 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 18 Jun 2025 16:20:11 +0000 (18:20 +0200)
commitfff0132399082b7d012d0c1291cf0c6c99e200ff
tree0a0629f264a1f6d827c6dae5e58d32c9c833240a
parent8311e7d6b4cf92cb90ee6abace271834e9af66f2
patch 9.1.1467: too many strlen() calls

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: #17561

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/fileio.c
src/findfile.c
src/if_cscope.c
src/mark.c
src/misc1.c
src/proto/misc1.pro
src/version.c
src/viminfo.c