aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--README4
-rw-r--r--config.mk4
-rw-r--r--median.14
-rw-r--r--median.c1
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 <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#if defined(__GNUC__)
# define PURE __attribute__((__pure__))