[libvirt] [PATCH] build: silence gettext warning

Michal Privoznik mprivozn at redhat.com
Wed Jun 13 09:48:33 UTC 2012


On 13.06.2012 05:47, Eric Blake wrote:
> Otherwise, 'make dist' gives multiple warnings like:
> 
> libvirt.pot:20814: warning: internationalized messages should not contain the `\r' escape sequence
> 
> * tools/virsh.c (vshAskReedit): Avoid \r in _().
> ---
> 
> Pushing under the trivial rule.
> 
>  tools/virsh.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index 744b629..90ea43d 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -690,10 +690,10 @@ vshAskReedit(vshControl *ctl, const char *msg)
>          c = c_tolower(getchar());
> 
>          if (c == '?') {
> -            vshPrint(ctl, "\r\n%s", _("y - yes, start editor again\r\n"
> -                                      "n - no, throw away my changes\r\n"
> -                                      "f - force, try to redefine again\r\n"
> -                                      "? - print this help\r\n"));
> +            vshPrint(ctl, "\r\n%s", _("y - yes, start editor again\n"
> +                                      "n - no, throw away my changes\n"
> +                                      "f - force, try to redefine again\n"
> +                                      "? - print this help\n"));
>              continue;
>          } else if (c == 'y' || c == 'n' || c == 'f') {
>              break;
> 

In fact, those '\r' are necessary since we are printing this when stdout
is in raw mode. Therefore '\n' doesn't return carriage at the beginning
of new line. So we need to move those '\r' characters into the
formatting string. Will post patch shortly.

Michal




More information about the libvir-list mailing list