On 12/02/2013 11:41 PM, Bernhard Voelker wrote:
> 
>>From 896554fd01d217ad4d823d883606377cb6d76124 Mon Sep 17 00:00:00 2001
> From: Bernhard Voelker <[email protected]>
> Date: Tue, 3 Dec 2013 00:38:15 +0100
> Subject: [PATCH] maint: avoid '%s' quoting notation in diagnostic messages
> 
> Add a new rule to ensure the use of quote() instead of '%s' or `%s'
> in format strings of diagnostics messages.
> 
> * cfg.mk (sc_prohibit_quotes_notation): Add rule.
> * TODO: Remove the entry regarding the '%s' notation.

Wasn't even aware of that entry :)

>    devmsg ("format String:\n  input: %s\n  grouping: %s\n"
>                     "  padding width: %ld\n  alignment: %s\n"
> -                   "  prefix: '%s'\n  suffix: '%s'\n",
> +                   "  prefix: %s\n  suffix: %s\n",
>            quote (fmt), (grouping) ? "yes" : "no",

does this need to be quote_n (0,... ?

>            padding_width,
>            (padding_alignment == MBS_ALIGN_LEFT) ? "Left" : "Right",
> -          format_str_prefix, format_str_suffix);
> +          quote_n (0, format_str_prefix), quote_n (1, format_str_suffix));

and this adjusted accordingly

> @@ -1067,8 +1068,8 @@ parse_human_number (const char *str, long double 
> /*output */ *value,
>    if (ptr && *ptr != '\0')
>      {
>        if (_invalid != inval_ignore)
> -        error (conv_exit_code, 0, _("invalid suffix in input '%s': '%s'"),
> -               str, ptr);
> +        error (conv_exit_code, 0, _("invalid suffix in input %s: %s"),
> +               quote (str), quote (ptr));

do these need to be quote_n?

thanks!
Pádraig.

Reply via email to