]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: avoid bogus description
authorEric Blake <eblake@redhat.com>
Mon, 20 Jun 2011 20:25:08 +0000 (14:25 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 21 Jun 2011 17:46:09 +0000 (11:46 -0600)
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.

tools/virsh.c

index a315f05c87c27e35aaa9375664211c743ae7e892..fcd254db7a66e6eff808077aa1e1c913e5b1ea6f 100644 (file)
@@ -12113,7 +12113,8 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname)
         vshError(ctl, _("command '%s' doesn't exist"), cmdname);
         return false;
     } 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"));
         char buf[256];
         uint32_t opts_need_arg;
@@ -12167,7 +12168,7 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname)
         if (desc[0]) {
             /* Print the description only if it's not empty.  */
             fputs(_("\n  DESCRIPTION\n"), stdout);
-            fprintf(stdout, "    %s\n", desc);
+            fprintf(stdout, "    %s\n", _(desc));
         }
 
         if (def->opts) {