Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 5f0f5e1a166b8ff04d0def8149fbcc8e > files > 6

texinfo-4.9-1mdv2008.0.src.rpm

--- texinfo-4.8/info/filesys.c.lzma	2004-07-30 19:17:40.000000000 +0200
+++ texinfo-4.8/info/filesys.c	2007-06-09 19:03:44.000000000 +0200
@@ -56,6 +56,7 @@ static char *info_suffixes[] = {
 static COMPRESSION_ALIST compress_suffixes[] = {
   { ".gz", "gunzip" },
   { ".bz2", "bunzip2" },
+  { ".lzma", "unlzma" },
   { ".z", "gunzip" },
   { ".Z", "uncompress" },
   { ".Y", "unyabba" },
--- texinfo-4.8/util/install-info.c.lzma	2007-07-11 01:04:45.000000000 +0200
+++ texinfo-4.8/util/install-info.c	2007-07-11 01:24:28.000000000 +0200
@@ -338,6 +338,11 @@ strip_info_suffix (char *fname)
       len -= 4;
       ret[len] = 0;
     }
+  else if (len > 5 && FILENAME_CMP (ret + len - 5, ".lzma") == 0)
+   {
+      len -= 5;
+      ret[len] =0;
+   }
 
   if (len > 5 && FILENAME_CMP (ret + len - 5, ".info") == 0)
     {
@@ -536,7 +541,7 @@ open_possibly_compressed_file (char *fil
 {
   char *local_opened_filename, *local_compression_program;
   int nread;
-  char data[4];
+  char data[13];
   FILE *f;
 
   /* We let them pass NULL if they don't want this info, but it's easier
@@ -556,6 +561,12 @@ open_possibly_compressed_file (char *fil
       *opened_filename = concat (filename, ".bz2", "");
       f = fopen (*opened_filename, FOPEN_RBIN);
     }
+  if (!f)
+    {
+     free (*opened_filename);
+     *opened_filename = concat (filename, ".lzma", "");
+     f = fopen (*opened_filename, FOPEN_RBIN);
+    }
 
 #ifdef __MSDOS__
       if (!f)
@@ -624,6 +635,16 @@ open_possibly_compressed_file (char *fil
 #else
     *compression_program = "bzip";
 #endif
+    /* We (try) match against old lzma format (which lacks proper header, two first matches)
+     * as well as new format (last match).  */
+  else if((data[9] == 0x00 && data[10] == 0x00 && data[11] == 0x00 && data[12] == 0x00)
+		  || (data[5] == 0xFF && data[6] == 0xFF && data[7] == 0xFF && data[8] == 0xFF && data[9] == 0xFF && data[10] == 0xFF && data[11] == 0xFF && data[12] == 0xFF)
+		  || (data[0] == '\xFF' && data[1] == 'L' && data[2] == 'Z' && data[3] == 'M' && data[4] == 'A' && data[5] == 0x00))
+#ifndef STRIP_DOT_EXE
+    *compression_program = "lzma.exe";
+#else
+    *compression_program = "lzma";
+#endif
   else
     *compression_program = NULL;