[libvirt] [PATCH] virsh: avoid bogus description

Dave Allan dallan at redhat.com
Tue Jun 21 03:55:14 UTC 2011


On Tue, Jun 21, 2011 at 10:22:38AM +0800, Wen Congyang wrote:
> At 06/21/2011 04:40 AM, Eric Blake Write:
> > 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 |    5 +++--
> >  1 files changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tools/virsh.c b/tools/virsh.c
> > index a315f05..bdd5005 100644
> > --- a/tools/virsh.c
> > +++ b/tools/virsh.c
> > @@ -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 until after we know it isn't "".  */
> 
> Can two prepositions use together?

I believe in this case "until" is being used as a conjunction.

Dave


> > +        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) {
> 
> The other looks good to me.
> 
> ACK except the comment.
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list




More information about the libvir-list mailing list