summaryrefslogtreecommitdiff
path: root/lzf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lzf.c')
-rw-r--r--lzf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lzf.c b/lzf.c
index a7a6a82..b608cc0 100644
--- a/lzf.c
+++ b/lzf.c
@@ -40,6 +40,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <assert.h>
#include <unistd.h>
@@ -203,6 +204,9 @@ main (int argc, char *argv[])
unsigned int blocksize = 64*1024-1;
enum { m_compress, m_decompress } mode = m_compress;
+ if (!strcmp (argv[0] + strlen (argv[0] - 5), "unlzf"))
+ mode = m_decompress;
+
while ((c = getopt (argc, argv, "cdb:h")) != -1)
switch (c)
{