[PATCH 5/9] vshReadlineParse: Rename @buf to @line

Michal Privoznik mprivozn at redhat.com
Tue Jan 26 13:27:09 UTC 2021


In next commit the block that does escaping of returned string
will be brought into this block. But both contain variable @buf
and use it in different contexts. Rename @buf from @state == 0
block to @line which reflects its purpose better.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 tools/vsh.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/vsh.c b/tools/vsh.c
index 9a7ca6776b..abbd323e24 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -2709,15 +2709,15 @@ vshReadlineParse(const char *text, int state)
         g_autoptr(vshCmd) partial = NULL;
         const vshCmdDef *cmd = NULL;
         const vshCmdOptDef *opt = NULL;
-        g_autofree char *buf = g_strdup(rl_line_buffer);
+        g_autofree char *line = g_strdup(rl_line_buffer);
 
         g_strfreev(list);
         list = NULL;
         list_index = 0;
 
-        *(buf + rl_point) = '\0';
+        *(line + rl_point) = '\0';
 
-        vshCommandStringParse(NULL, buf, &partial);
+        vshCommandStringParse(NULL, line, &partial);
 
         if (partial) {
             cmd = partial->def;
-- 
2.26.2




More information about the libvir-list mailing list