From 35786b3754b7615b229ddc09f1e9c022e36cca67 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 22 Feb 2026 13:05:17 +0100 Subject: m fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 2 +- README | 4 ++-- config.mk | 4 ++-- median.1 | 4 ++-- median.c | 1 + 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e12763a..cebd255 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: +.POSIX: CONFIGFILE = config.mk include $(CONFIGFILE) diff --git a/README b/README index eea8c25..07d1f6b 100644 --- a/README +++ b/README @@ -17,8 +17,8 @@ DESCRIPTION string as the key, for lines with a blank space, the first blank space is parsed as part of the key. - For groups with an even number of elements, if the mean of - the middle two values are used as the median if all values + For groups with an even number of elements, the mean of + the middle two values is used as the median if all values in the group are numerical, otherwise the lower value is used as the median. diff --git a/config.mk b/config.mk index aa81003..bc78e3e 100644 --- a/config.mk +++ b/config.mk @@ -1,8 +1,8 @@ PREFIX = /usr MANPREFIX = $(PREFIX)/share/man -CC = cc +CC = c99 CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -CFLAGS = -std=c99 -Wall -O2 +CFLAGS = LDFLAGS = -s diff --git a/median.1 b/median.1 index f4756af..923fece 100644 --- a/median.1 +++ b/median.1 @@ -18,8 +18,8 @@ Lines without a blank space are parsed as having the empty string as the key, for lines with a blank space, the first blank space is parsed as part of the key. .PP -For groups with an even number of elements, if the mean of -the middle two values are used as the median if all values +For groups with an even number of elements, the mean of +the middle two values is used as the median if all values in the group are numerical, otherwise the lower value is used as the median. .SH EXAMPLES diff --git a/median.c b/median.c index 693b8fd..b02e17a 100644 --- a/median.c +++ b/median.c @@ -5,6 +5,7 @@ #include #include #include +#include #if defined(__GNUC__) # define PURE __attribute__((__pure__)) -- cgit v1.2.3-70-g09d2