]> git.ipfire.org Git - thirdparty/libvirt.git/commit
vshReadlineInit: Initialize only once
authorPeter Krempa <pkrempa@redhat.com>
Thu, 25 Apr 2024 08:15:53 +0000 (10:15 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 25 Apr 2024 12:13:19 +0000 (14:13 +0200)
commitdbf7b727fb7ec5dd806c216f49a1ee87d64fa09f
treed1cfe1ff7c4517fdf482275dfae926f6aaed66a3
parent41400ac1dda55b817388a4050aa823051bda2e05
vshReadlineInit: Initialize only once

'vshReadlineInit' is called when interactive virsh is started but also
on each call to 'cmdComplete'. Calling it repeatedly (using the
'complete' command interactively, or multiple times in batch mode) leaks
the buffers for history file configuration.

Avoid multiple setups of this function by returning success in case the
history file config is already present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tools/vsh.c