texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * install-info/install-info.c (strip_info_suffix,


From: Gavin D. Smith
Subject: branch master updated: * install-info/install-info.c (strip_info_suffix, open_possibly_compressed_file): Recognize .zst file extension from the zstd compression tool.
Date: Sun, 25 Sep 2022 04:34:19 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 650c80b5ac * install-info/install-info.c (strip_info_suffix, 
open_possibly_compressed_file): Recognize .zst file extension from the zstd 
compression tool.
650c80b5ac is described below

commit 650c80b5ac1d6c3c0026310dd2fe8a79a77b6384
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Sep 25 09:34:10 2022 +0100

    * install-info/install-info.c
    (strip_info_suffix, open_possibly_compressed_file):
    Recognize .zst file extension from the zstd compression tool.
    
    * info/filesys.c (compress_suffixes): Ditto.
---
 ChangeLog                   |  8 ++++++++
 info/filesys.c              |  1 +
 install-info/install-info.c | 11 +++++++++++
 3 files changed, 20 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index f90eb89587..63782253ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-09-25  Sam James  <sam@gentoo.org>  (tiny change)
+
+       * install-info/install-info.c
+       (strip_info_suffix, open_possibly_compressed_file):
+       Recognize .zst file extension from the zstd compression tool.
+
+       * info/filesys.c (compress_suffixes): Ditto.
+
 2022-09-24  Gavin Smith  <gavinsmith0123@gmail.com>
 
        * doc/texinfo.tex (\ifmonotype): Replace with \ifusingtt which
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);



reply via email to

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