Package: most
Version: 4.10.2-5
Tags: patch
Severity: wishlist

Most currently does not support opening LZMA encrypted file. The
current patch should fix this.

Regards,
Mako

-- 
Benjamin Mako Hill
[EMAIL PROTECTED]
http://mako.cc/

Creativity can be a social contribution, but only in so far
as society is free to use the results. --GNU Manifesto
diff -rNu most-4.10.2-orig/changes.txt most-4.10.2/changes.txt
--- most-4.10.2-orig/changes.txt        2008-01-14 14:23:35.412040574 +0000
+++ most-4.10.2/changes.txt     2008-01-14 14:37:52.586462261 +0000
@@ -1,3 +1,6 @@
+Changes since 4.10.1-lzma-1
+1. src/file.c:open_compressed_file: added support for lzma compressed files
+
 Changes since 4.10.1
 1. src/window.c:most_read_from_minibuffer: An variable was not being
    initialized. (Kevin Oberman, oberman at es, net).
diff -rNu most-4.10.2-orig/src/file.c most-4.10.2/src/file.c
--- most-4.10.2-orig/src/file.c 2008-01-14 14:23:35.418706782 +0000
+++ most-4.10.2/src/file.c      2008-01-14 14:54:25.578216198 +0000
@@ -63,7 +63,7 @@
 static int open_compressed_file(char *file, int mode, int *size)
 {
    int fd;
-   char buf[4], cmdbuf[512 + MAX_PATHLEN];
+   char buf[6], cmdbuf[512 + MAX_PATHLEN];
    struct stat st;
 
 # ifdef O_BINARY
@@ -83,7 +83,7 @@
 
    if (fd < 0) return fd;
 
-   if (4 == read(fd, buf, 4))
+   if (6 == read(fd, buf, 6))
      {
        char *cmd = NULL;
 
@@ -99,6 +99,13 @@
          {
             cmd = MOST_BZIP2_POPEN_FORMAT;
          }
+       else if ((buf[0] == (char) 0xff)
+           && (buf[1] == 'L') && (buf[2] == 'Z')
+           && (buf[3] == 'M') && (buf[4] == 'A')
+           && (buf[5] == (char) 0x00))
+         {
+            cmd = MOST_LZMA_POPEN_FORMAT;
+         }
        
        if (cmd != NULL)
          {
diff -rNu most-4.10.2-orig/src/file.h most-4.10.2/src/file.h
--- most-4.10.2-orig/src/file.h 2008-01-14 14:23:35.438705407 +0000
+++ most-4.10.2/src/file.h      2008-01-14 14:40:13.140135660 +0000
@@ -3,6 +3,7 @@
 #define MOST_MAX_FILES 4096
 #define MOST_GUNZIP_POPEN_FORMAT "gzip -dc '%s'"
 #define MOST_BZIP2_POPEN_FORMAT "bzip2 -dc '%s'"
+#define MOST_LZMA_POPEN_FORMAT "lzma -dc '%s'"
 
 extern void most_reread_file (void);
 extern void most_read_to_line (int);

Attachment: signature.asc
Description: Digital signature

Reply via email to