mirror_qemu/monitor
Dongli Zhang 76f5801a83 readline: fix hmp completion issue
The auto completion does not work in some cases.

Case 1.

1. (qemu) info reg
2. Press 'Tab'.
3. It does not auto complete.

Case 2.

1. (qemu) block_resize flo
2. Press 'Tab'.
3. It does not auto complete 'floppy0'.

Since the readline_add_completion_of() may add any completion when
strlen(pfx) is zero, we remove the check with (name[0] == '\0') because
strlen() always returns zero in that case.

Fixes: 52f50b1e9f ("readline: Extract readline_add_completion_of() from monitor")
Cc: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Message-Id: <20230207045241.8843-1-dongli.zhang@oracle.com>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2023-03-01 20:46:07 +01:00
..
fds.c monitor: Split file descriptor passing stuff off misc.c 2023-02-04 07:56:54 +01:00
hmp-cmds-target.c monitor: Move target-dependent HMP commands to hmp-cmds-target.c 2023-02-04 07:56:54 +01:00
hmp-cmds.c monitor: Move remaining HMP commands from misc.c to hmp-cmds.c 2023-02-04 07:56:54 +01:00
hmp-target.c monitor: Rename misc.c to hmp-target.c 2023-02-04 07:56:54 +01:00
hmp.c readline: fix hmp completion issue 2023-03-01 20:46:07 +01:00
meson.build monitor: Rename misc.c to hmp-target.c 2023-02-04 07:56:54 +01:00
monitor-internal.h hmp: Rename help_cmd() to hmp_help_cmd(), move declaration to hmp.h 2023-02-04 07:56:54 +01:00
monitor.c monitor: Loosen coupling between misc.c and monitor.c slightly 2023-02-04 07:56:54 +01:00
qmp-cmds-control.c monitor: Drop unnecessary includes 2023-02-04 07:56:52 +01:00
qmp-cmds.c monitor: Move remaining QMP stuff from misc.c to qmp-cmds.c 2023-02-04 07:56:54 +01:00
qmp.c monitor/qmp: fix race on CHR_EVENT_CLOSED without OOB 2021-05-12 17:29:11 +02:00
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00