Re: [PATCH 1/2] am: handle stray $dotest directory
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 14, 2013, 15:19 UTC
- Message-ID
- <7v1u84ra77.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CALkWK0m6r4yRfCLb3dejdY+1KJgdOHPfrvPXbftNucApXFx+0A@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
> Junio C Hamano wrote: >> $dotest, or \$dotest? > > Works fine for me like this. Why do we escape the dollar in the other strings?
The reason would become clear once you think what string you are feeding eval_gettext with if you do not escape. The translators translate a fixed string (possibly with placeholders) to a fixed translated string (possibly with placeholders).
eval_gettext "Stray $dotest directory found. ..."
would allow the shell to expand $dotest before eval_gettext sees it, which would mean the string is no longer a constant.