support stdin mode like original ssdeep
authorHelmut Grohne <helmut@subdivi.de>
Sun, 24 Mar 2013 13:14:15 +0000 (14:14 +0100)
committerHelmut Grohne <helmut@subdivi.de>
Sun, 24 Mar 2013 13:14:15 +0000 (14:14 +0100)
fuzzy.c

diff --git a/fuzzy.c b/fuzzy.c
index 32b19ad..fd36039 100644 (file)
--- a/fuzzy.c
+++ b/fuzzy.c
@@ -391,5 +391,10 @@ int main(int argc, char **argv) {
                printf("%s,\"%s\"\n", digest, p);
                free(p);
        }
+       if(argc == 1) {
+               if(fuzzy_hash_stream(stdin, digest) < 0)
+                       return 1;
+               printf("%s,\"stdin\"\n", digest);
+       }
        return 0;
 }