bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] * install-info/install-info.c: Recognize .zst file extension


From: Sam James
Subject: Re: [PATCH] * install-info/install-info.c: Recognize .zst file extension from the zstd compression tool.
Date: Fri, 9 Sep 2022 02:53:18 +0100


> On 7 Sep 2022, at 04:50, Sam James <sam@gentoo.org> wrote:
> 
> * info/filesys.c: Ditto.
> ---

The GNU Emacs side of this change has landed:
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=6b7dc132afe99e1b188882d32371b06021f64e95.

> ChangeLog                   |  7 +++++++
> info/filesys.c              |  1 +
> install-info/install-info.c | 11 +++++++++++
> 3 files changed, 19 insertions(+)
> 
> diff --git a/ChangeLog b/ChangeLog
> index 9cc73e4e3a..88369eae7a 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,10 @@
> +2022-09-07  Sam James  <sam@gentoo.org>
> +
> +     * install-info/install-info.c: Recognize .zst file
> +     extension from the zstd compression tool.
> +
> +     * info/filesys.c: Ditto.
> +
> 2022-09-05  Gavin Smith  <gavinsmith0123@gmail.com>
> 
>       * doc/texinfo.tex (\cartouche): Use \vtop instead of \vbox
> diff --git a/info/filesys.c b/info/filesys.c
> index 5f27f58b6b..47060e002e 100644
> --- a/info/filesys.c
> +++ b/info/filesys.c
> @@ -67,6 +67,7 @@ static COMPRESSION_ALIST compress_suffixes[] = {
>   { ".z", "gunzip" },
>   { ".lzma", "unlzma" },
>   { ".Z", "uncompress" },
> +  { ".zst", "unzstd --rm -q" },
>   { ".Y", "unyabba" },
> #ifdef __MSDOS__
>   { "gz", "gunzip" },
> diff --git a/install-info/install-info.c b/install-info/install-info.c
> index 263875504f..69449386cd 100644
> --- a/install-info/install-info.c
> +++ b/install-info/install-info.c
> @@ -388,6 +388,11 @@ strip_info_suffix (char *fname)
>       len -= 4;
>       ret[len] = 0;
>     }
> +  else if (len > 4 && FILENAME_CMP (ret + len - 4, ".zst") == 0)
> +    {
> +      len -= 4;
> +      ret[len] = 0;
> +    }
>   else if (len > 3 && FILENAME_CMP (ret + len - 3, ".lz") == 0)
>     {
>       len -= 3;
> @@ -670,6 +675,12 @@ open_possibly_compressed_file (char *filename,
>       *opened_filename = concat (filename, ".bz2", "");
>       f = fopen (*opened_filename, FOPEN_RBIN);
>     }
> +  if (!f)
> +    {
> +      free (*opened_filename);
> +      *opened_filename = concat (filename, ".zst", "");
> +      f = fopen (*opened_filename, FOPEN_RBIN);
> +    }
>   if (!f)
>     {
>       free (*opened_filename);
> --
> 2.37.3
> 

Attachment: signature.asc
Description: Message signed with OpenPGP


reply via email to

[Prev in Thread] Current Thread [Next in Thread]