[PATCH 2/2] ldd: Don't use Bash-only $"msgid" quoting

Dmitry V. Levin ldv@altlinux.org
Fri Nov 23 10:46:00 GMT 2012


On Thu, Nov 22, 2012 at 10:42:12PM -0500, P. J. McDermott wrote:
> On non-Bash shells, ldd prints translatable strings in English
> (regardless of the environment's locale) and prefixed with dollar signs,
> e.g.:
> 
>     $ export LC_ALL=es_ES.UTF-8
>     $ /bin/dash /usr/bin/ldd --invalid
>     ldd: $unrecognized option `--invalid'
>     $Try `ldd --help' for more information.
> 
> This patch makes ldd use the more portable (and secure) gettext utility
> and eval_gettext function.
> 
> 2012-11-22  P. J. McDermott  <pjm@nac.net>
> 
> 	* elf/ldd.bash.in: Use gettext utility and eval_gettext function instead
> 	of insecure and unportable Bash $"msgid" quoting.

Note that bash $"msgid" syntax works without gettext being installed,
so bash-based ldd, unlike your edition, can work without gettext.
That is, your patch achieves portability by penalizing some installs with
artificial requirements.  Also, there are no runtime checks for gettext
availability, so there is a chance to lose messages.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20121123/fb0b0991/attachment.sig>


More information about the Libc-alpha mailing list