mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-08 12:41:29 +00:00
virsh: avoid bogus description
https://bugzilla.redhat.com/show_bug.cgi?id=682121 Gettext reserves the empty string for internal use, and it must not be passed through _(). We were violating this for commands that (for whatever reason) used "" for their description. * tools/virsh.c (vshCmddefHelp): Don't translate empty string. Reported by Tatsuo Kawasaki.
This commit is contained in:
parent
cbd8227ee0
commit
491858bf3c
@ -12113,7 +12113,8 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname)
|
|||||||
vshError(ctl, _("command '%s' doesn't exist"), cmdname);
|
vshError(ctl, _("command '%s' doesn't exist"), cmdname);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
const char *desc = _(vshCmddefGetInfo(def, "desc"));
|
/* Don't translate desc if it is "". */
|
||||||
|
const char *desc = vshCmddefGetInfo(def, "desc");
|
||||||
const char *help = _(vshCmddefGetInfo(def, "help"));
|
const char *help = _(vshCmddefGetInfo(def, "help"));
|
||||||
char buf[256];
|
char buf[256];
|
||||||
uint32_t opts_need_arg;
|
uint32_t opts_need_arg;
|
||||||
@ -12167,7 +12168,7 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname)
|
|||||||
if (desc[0]) {
|
if (desc[0]) {
|
||||||
/* Print the description only if it's not empty. */
|
/* Print the description only if it's not empty. */
|
||||||
fputs(_("\n DESCRIPTION\n"), stdout);
|
fputs(_("\n DESCRIPTION\n"), stdout);
|
||||||
fprintf(stdout, " %s\n", desc);
|
fprintf(stdout, " %s\n", _(desc));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (def->opts) {
|
if (def->opts) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user