summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Sommer <joerg@jo-so.de>2024-01-01 19:10:16 +0100
committerOliver Kiddle <opk@zsh.org>2024-01-28 00:23:22 +0100
commitce033e2b9cadf51b4d043b0737fd3acee9f5eef2 (patch)
tree14828c1c0ed6a318551306774551fdb8fc54fbbd
parent698af7bc1387462c8e87767d7eaeb7e30c6f0b2b (diff)
downloadzsh-ce033e2b9cadf51b4d043b0737fd3acee9f5eef2.tar.gz
zsh-ce033e2b9cadf51b4d043b0737fd3acee9f5eef2.zip
52440: zle.textobjects: Mark variables as const
Because these variables are initialized with as constant string, they should be marked as *const* to make the compiler running with `-Wwrite-strings` more happy.
-rw-r--r--ChangeLog4
-rw-r--r--Src/Zle/textobjects.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e73320081..22875c7e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-01-28 Oliver Kiddle <opk@zsh.org>
+
+ * Jörg Sommer: 52440: Src/Zle/textobjects.c: Mark variables as const
+
2024-01-26 Oliver Kiddle <opk@zsh.org>
* 52405, 52502: Src/Modules/pcre.c, Test/V07pcre.ztst:
diff --git a/Src/Zle/textobjects.c b/Src/Zle/textobjects.c
index c93777b65..a68c5296e 100644
--- a/Src/Zle/textobjects.c
+++ b/Src/Zle/textobjects.c
@@ -283,9 +283,9 @@ selectargument(UNUSED(char **args))
free(linein);
if (IS_THINGY(bindk, selectinshellword)) {
- ZLE_CHAR_T *match = ZWS("`\'\"");
- ZLE_CHAR_T *lmatch = ZWS("\'({"), *rmatch = ZWS("\')}");
- ZLE_CHAR_T *ematch = match, *found;
+ const ZLE_CHAR_T *match = ZWS("`\'\"");
+ const ZLE_CHAR_T *lmatch = ZWS("\'({"), *rmatch = ZWS("\')}");
+ const ZLE_CHAR_T *ematch = match, *found;
int start, end = zlecs;
/* for 'in' widget, don't include initial blanks ... */
while (mark < zlecs && ZC_iblank(zleline[mark]))