Commit: patch 9.1.2147: Compile warning in strings.c

1 view
Skip to first unread message

Christian Brabandt

unread,
Feb 13, 2026, 3:01:41 AM (5 days ago) Feb 13
to vim...@googlegroups.com
patch 9.1.2147: Compile warning in strings.c

Commit: https://github.com/vim/vim/commit/388654af27a6e422172d6ee6c40b061f5dd6dfa0
Author: John Marriott <basi...@internode.on.net>
Date: Fri Feb 13 08:45:29 2026 +0100

patch 9.1.2147: Compile warning in strings.c

Problem: Compile warning in strings.c
Solution: Use const qualifier (John Marriott).

closes: #19387

Signed-off-by: John Marriott <basi...@internode.on.net>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index 87a702cfe..a1dfbc9d9 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -1,4 +1,4 @@
-*version9.txt* For Vim version 9.1. Last change: 2026 Feb 12
+*version9.txt* For Vim version 9.1. Last change: 2026 Feb 13


VIM REFERENCE MANUAL by Bram Moolenaar
@@ -52557,4 +52557,8 @@ Patch 9.1.2146
Problem: filetype: cel files are not recognized
Solution: Detect *.cel files as cel filetype (Stefan VanBuren).

+Patch 9.1.2147
+Problem: Compile warning in strings.c
+Solution: Use const qualifier (John Marriott).
+
vim:tw=78:ts=8:noet:ft=help:norl:fdm=manual:nofoldenable
diff --git a/src/strings.c b/src/strings.c
index f4b335676..f2176f1c4 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -3156,7 +3156,7 @@ parse_fmt_types(
{
if (*p != '%')
{
- char *q = strchr(p + 1, '%');
+ const char *q = strchr(p + 1, '%');
size_t n = (q == NULL) ? STRLEN(p) : (size_t)(q - p);

p += n;
@@ -3557,7 +3557,7 @@ vim_vsnprintf_typval(
{
if (*p != '%')
{
- char *q = strchr(p + 1, '%');
+ const char *q = strchr(p + 1, '%');
size_t n = (q == NULL) ? STRLEN(p) : (size_t)(q - p);

// Copy up to the next '%' or NUL without any changes.
@@ -3885,7 +3885,7 @@ vim_vsnprintf_typval(
else
{
// memchr on HP does not like n > 2^31 !!!
- char *q = memchr(str_arg, '
+ const char *q = memchr(str_arg, '
precision <= (size_t)0x7fffffffL ? precision
: (size_t)0x7fffffffL);

diff --git a/src/version.c b/src/version.c
index 963161df4..b521788dd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2147,
/**/
2146,
/**/
Reply all
Reply to author
Forward
0 new messages