]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vshReadlineParse: Rename @buf to @line
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 26 Jan 2021 08:23:10 +0000 (09:23 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 26 Jan 2021 15:46:41 +0000 (16:46 +0100)
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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tools/vsh.c

index 9a7ca6776b15d02c81f7d9466f2a9e00c803419f..abbd323e249ee28c8521bcb397105828b5aad12f 100644 (file)
@@ -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;