From 3b95e1e20747b5cff6e5375f8a19ff914146618e Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Thu, 21 Oct 2021 15:46:08 +0200 Subject: [PATCH] mlmmj-list: use printf when it make sense --- Makefile.am | 13 +++++++++++++ configure.ac | 3 +++ src/mlmmj-list.c | 7 ++----- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index bd1ad59c..2630f7a3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 $< $@ + diff --git a/configure.ac b/configure.ac index 58a02cce..e29adf59 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/src/mlmmj-list.c b/src/mlmmj-list.c index 2337e6a6..767b1429 100644 --- a/src/mlmmj-list.c +++ b/src/mlmmj-list.c @@ -32,7 +32,6 @@ #include #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; } } -- 2.47.3