Re: [PATCH v2 03/13] libdpkg: factor out common gzip, bzip2 code
On Sat, 2009-10-24 at 17:41:02 -0500, Jonathan Nieder wrote:
> If only C had templates! Without function templates, macros
> like these two will have to do.
>
> This patch refactors the callers for zlib and libbz2 library
> functions to share some code, in preparation for some small
> changes that apply to both.
Oh! forgot this:
> diff --git a/lib/dpkg/compression.c b/lib/dpkg/compression.c
> index f7444af..22e1af7 100644
> --- a/lib/dpkg/compression.c
> +++ b/lib/dpkg/compression.c
> @@ -36,6 +36,67 @@ fd_fd_filter(int fd_in, int fd_out,
> ohshite(_("%s: failed to exec '%s %s'"), desc, cmd, args);
> }
>
> +#define DECOMPRESS(format, zFile, zdopen, zread, zerror, ERR_ERRNO, \
> + fd_in, fd_out, desc) do \
> +{ \
[...]
> + ohshite(_("%s: internal " format " error: `%s'"), desc, errmsg); \
The format string cannot be concatenated this way or xgettext will not
see the different strings at extraction time, neither will gettext be
able to match them at runtime.
regards,
guillem
Reply to: