summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-08-10 05:40:57 +0200
committerIngo Schwarze <schwarze@openbsd.org>2018-08-11 00:17:53 +0200
commitf1af4b0b05e79c96cef886442681e12b3fca0184 (patch)
treef141c91c6dae88bd4a2935a22a9d7b199558ffc4 /Makefile.am
parenta519a612a98f0ef9a570242bfd85984d22b5864f (diff)
downloadgroff-git-f1af4b0b05e79c96cef886442681e12b3fca0184.tar.gz
Makefile.am: correctly calculate MAJOR_VERSION etc.
In a BRE, "\+" does not mean "one or more repetitions". Fix the calculation by using cut(1) instead of sed(1), which is also in POSIX and much simpler for this task. OK wl@
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am6
1 files changed, 3 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index ad2d84d1d..6021f79d9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -636,9 +636,9 @@ endif
#
# Also see configure.ac for the related SHORT_VERSION macro.
-MAJOR_VERSION =`echo $(VERSION) | sed 's/\([0-9]\+\)\.[0-9]\+.*/\1/'`
-MINOR_VERSION =`echo $(VERSION) | sed 's/[0-9]\+\.\([0-9]\+\).*/\1/'`
-REVISION = `echo $(VERSION) | sed 's/[0-9]\+\.[0-9]\+\.\(.*\)/\1/'`
+MAJOR_VERSION = `echo $(VERSION) | cut -d . -f 1`
+MINOR_VERSION = `echo $(VERSION) | cut -d . -f 2`
+REVISION = `echo $(VERSION) | cut -d . -f 3`
# Non-recursive makefile system. See Automake manual '7.3 An
# Alternative Approach to Subdirectories'. We use a single Makefile.am