]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Display an error when trying to read a Z file
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Thu, 11 Jun 2015 16:25:41 +0000 (18:25 +0200)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Thu, 11 Jun 2015 16:25:41 +0000 (18:25 +0200)
Z compressed files are not supported any longer because I want to use
libraries instead of relying on external processes to parse compressed
files. I haven't found a library or piece of code to read those files.

It is my understanding that the Z format is not used much these days. If
you think otherwise, please open a bug ticket.

decomp.c

index 26873fe5a4abbdcc2199a57f40921204664d6980..28be9076a2e06b8d442d276779e9625d0334ec65 100644 (file)
--- a/decomp.c
+++ b/decomp.c
@@ -339,6 +339,15 @@ FileObject *decomp(const char *arq)
                exit(EXIT_FAILURE);
 #endif
        }
+       else if (buf[0]==0x1F && (buf[1]==0x9D || buf[1]==0xA0))//LZW and LZH compressed file
+       {
+               debuga(__FILE__,__LINE__,_("Support for LZW and LZH compressed files was removed in sarg 2.4.\n"
+                                                                  "You can still read such a file with a command like this:\n"
+                                                                  "  zcat \"%s\" | sarg - [your usual options here]\n"
+                                                                  "If you think it is important for sarg to read those files, open a bug ticket at <http://sourceforge.net/p/sarg/bugs/>.\n"),
+                          arq);
+               exit(EXIT_FAILURE);
+       }
        else //normal file
        {
                fi=FileObject_FdOpen(fd);