]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
mlmmj-list: use printf when it make sense
authorBaptiste Daroussin <bapt@FreeBSD.org>
Thu, 21 Oct 2021 13:46:08 +0000 (15:46 +0200)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Thu, 21 Oct 2021 13:46:08 +0000 (15:46 +0200)
Makefile.am
configure.ac
src/mlmmj-list.c

index bd1ad59c5a531880753fdb1b03292f6123f01165..2630f7a3ca8fc62b1fd850f94b97a8841e764e2c 100644 (file)
@@ -12,3 +12,16 @@ man1_MANS = man/mlmmj-bounce.1 man/mlmmj-make-ml.1 man/mlmmj-receive.1 \
            man/mlmmj-send.1 man/mlmmj-unsub.1 man/mlmmj-list.1
 
 SUBDIRS = src listtexts contrib
+
+test_scripts = tests/mlmmj-list.sh
+
+check_SCRIPTS=$(test_scripts:.sh=)
+SUFFIXES=.sh
+
+check: $(check_SCRIPTS)
+       kyua --config=none test --kyuafile='$(top_builddir)/Kyuafile' \
+               --build-root='$(top_builddir)'
+
+.sh:
+       install -m 755 $< $@
+
index 58a02cceb264674b3f29d46e37f1f10b2954d6c6..e29adf59296f72fa1867fd561812474edd59f66f 100644 (file)
@@ -51,4 +51,7 @@ AC_CONFIG_FILES([src/mlmmj-make-ml])
 AC_CONFIG_FILES([listtexts/Makefile])
 AC_CONFIG_FILES([contrib/Makefile])
 AC_CONFIG_FILES([contrib/receivestrip/Makefile])
+AC_CONFIG_FILES([Kyuafile])
+AC_CONFIG_FILES([tests/Kyuafile])
+AC_CONFIG_FILES([tests/test_env.sh])
 AC_OUTPUT
index 2337e6a69fd23a7b4b3d7f824cd89da161727942..767b1429b5788f8511a18b373259d70920dcc7a5 100644 (file)
@@ -32,7 +32,6 @@
 #include <sys/mman.h>
 
 #include "mlmmj.h"
-#include "wrappers.h"
 #include "memory.h"
 #include "strgen.h"
 #include "log_error.h"
@@ -85,10 +84,8 @@ int dumpcount(const char *filename, int *count)
                                len++;
                        if(count)
                                (*count)++;
-                       else {
-                               writen(STDOUT_FILENO, cur, len);
-                               writen(STDOUT_FILENO, "\n", 1);
-                       }
+                       else
+                               printf("%.*s\n", (int)len, cur);
                        cur = next + 1;
                }
        }