[pacman-dev] [PATCH 1/1] always accept untranslated answers 'Y' and 'N'

Lukas Fleischer lfleischer at archlinux.org
Fri Nov 11 20:23:40 UTC 2016


On Fri, 11 Nov 2016 at 21:15:48, Christian Hesse wrote:
> From: Christian Hesse <mail at eworm.de>
> 
> 'YES' translates to 'JA' in German, thus answer 'J' is expected for
> positive answer. This changes the behaviour to always accept 'Y'
> and 'N', in addition to the translated values.
> 
> Signed-off-by: Christian Hesse <mail at eworm.de>
> ---
>  src/pacman/util.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/src/pacman/util.c b/src/pacman/util.c
> index fd7438b..e878cb3 100644
> --- a/src/pacman/util.c
> +++ b/src/pacman/util.c
> @@ -1587,9 +1587,13 @@ static int question(short preset, const char *format, va_list args)
>                         fprintf(stream, "%s\n", response);
>                 }
>  
> -               if(mbscasecmp(response, _("Y")) == 0 || mbscasecmp(response, _("YES")) == 0) {
> +               if(mbscasecmp(response, "Y") == 0 /* always accept untranslated */
> +                               || mbscasecmp(response, _("Y")) == 0
> +                               || mbscasecmp(response, _("YES")) == 0) {
>                         return 1;
> -               } else if(mbscasecmp(response, _("N")) == 0 || mbscasecmp(response, _("NO")) == 0) {
> +               } else if(mbscasecmp(response, "N") == 0 /* always accept untranslated */
> +                               || mbscasecmp(response, _("N")) == 0
> +                               || mbscasecmp(response, _("NO")) == 0) {

Not sure whether it is a problem in practice but what happens if "N" is
translated to "Y" in some language? Do we really want to accept if the
user enters "Y" in that case?

>                         return 0;
>                 }
>         }
> -- 
> 2.10.2


More information about the pacman-dev mailing list