From 6201719e3a21f54d4cb149c6b3d7ceba0941da38 Mon Sep 17 00:00:00 2001
From: Anders Blomdell <anders.blomdell@control.lth.se>
Date: Thu, 4 Oct 2018 11:42:57 +0200
Subject: [PATCH] Corrected --zero-terminated handling

---
 md5toc.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/md5toc.c b/md5toc.c
index 1eaf676..aa65748 100644
--- a/md5toc.c
+++ b/md5toc.c
@@ -62,7 +62,7 @@ void usage()
           "  -c, --clear-xattr          remove MD5 extended attribute\n"
           "  -m, --max-age     SECONDS  max age of MD5 extended attribute\n"
           "  -v, --verbose              be verbose\n"
-          "      --print0               nul terminated lines\n");
+          "  -z, --zero-terminated      zero terminated lines\n");
   exit(1);
 }
 
@@ -381,20 +381,20 @@ int main(int argc, char *argv[])
     .max_age = 0
   };
   static struct option long_options[] = {
-    {"help",        no_argument,       NULL,  'h' },
-    {"xattr",       no_argument,       NULL,  'x' },
-    {"read-xattr",  no_argument,       NULL,  'r' },
-    {"write-xattr", no_argument,       NULL,  'w' },
-    {"clear-xattr", no_argument,       NULL,  'c' },
-    {"max-age",     required_argument, NULL,  'm' },
-    {"verbose",     no_argument,       NULL,  'v' },
-    {"print0",      no_argument,       NULL,  'z' },
-    {0,             0,                 NULL,  0 }
+    {"help",            no_argument,       NULL,  'h' },
+    {"xattr",           no_argument,       NULL,  'x' },
+    {"read-xattr",      no_argument,       NULL,  'r' },
+    {"write-xattr",     no_argument,       NULL,  'w' },
+    {"clear-xattr",     no_argument,       NULL,  'c' },
+    {"max-age",         required_argument, NULL,  'm' },
+    {"verbose",         no_argument,       NULL,  'v' },
+    {"zero-terminated", no_argument,       NULL,  'z' },
+    {0,                 0,                 NULL,  0 }
   };
 
   while (1) {
     int v, i = 0;
-    v = getopt_long(argc, argv, "hxrwcm:v", long_options, &i);
+    v = getopt_long(argc, argv, "hxrwcm:vz", long_options, &i);
     if (v == -1) break;
     switch (v) {
       case 'h':
-- 
GitLab