Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH 5/5: Move variable into scope where it's used



This might have caused a valgrind warning when zlecs == zlell
and zleline[zlell] was uninitialized, but I didn't actually get any. It
still makes sense to move this variable into the else branch, though.
---
 Src/Zle/zle_misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
index 98a7fb0931..53345f2a29 100644
--- a/Src/Zle/zle_misc.c
+++ b/Src/Zle/zle_misc.c
@@ -853,11 +853,11 @@ whatcursorposition(UNUSED(char **args))
     char msg[100];
     char *s = msg, *mbstr;
     int bol = findbol(), len;
-    ZLE_CHAR_T c = zleline[zlecs];
 
     if (zlecs == zlell)
 	strucpy(&s, "EOF");
     else {
+	ZLE_CHAR_T c = zleline[zlecs];
 	strucpy(&s, "Char: ");
 	switch (c) {
 	case ZWC(' '):
-- 
2.38.1





Messages sorted by: Reverse Date, Date, Thread, Author