Re: [PATCH] Fixed translation error in config.c file
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- May 7, 2015, 16:28 UTC
- Message-ID
- <CAPig+cSNj2_JVH=nU=pSkHmdW_Yvd0aLC8Hk5we9r=mduKDj=g@mail.gmail.com>
- In-Reply-To
- <554a8472.8c3bc20a.458e.ffffdae7@mx.google.com>
On Wed, May 6, 2015 at 4:51 PM, Alangi Derick <alangiderick@gmail.com> wrote:
Show 16 quoted lines
> There was an existing translation in 'git config' output, that was
> incorrect in some unspecified way, and this change corrects that
> breakage
>
> Signed-off-by: Alangi Derick <alangiderick@gmail.com>
> ---
> diff --git a/builtin/config.c b/builtin/config.c
> index bfd3016..47c1a42 100644
> --- a/builtin/config.c
> +++ b/builtin/config.c
> @@ -193,7 +193,7 @@ static int get_value(const char *key_, const char *regex_)
>
> key_regexp = (regex_t*)xmalloc(sizeof(regex_t));
> if (regcomp(key_regexp, key, REG_EXTENDED)) {
> - fprintf(stderr, "Invalid key pattern: %s\n", key_);
> + error(_("Invalid key pattern: %s\n"), key_);A couple comments:
As a convenience, error() automatically outputs a newline (\n) after the message, therefore, when you convert this from fprintf() to error(), you will need to remove the '\n' from the string.
Changing fprintf() calls to error() is a very distinct change from marking strings for translation by wrapping them with _(...), therefore the fprintf()-to-error() change should be done separately in its own patch. (And, that patch should only change fprintf() to error(); it should not do the _(...) wrapping.)
> free(key_regexp); > key_regexp = NULL; > ret = CONFIG_INVALID_PATTERN;