From: Francesco Poli <invernomuto@paranoici.org>
Date: Sun, 15 Oct 2023 23:36:23 +0200
Subject: Manpage spelling & line wrap fixes

Bug-Debian: http://bugs.debian.org/602081
Forwarded: yes

Author: Martin Buck <mbuck@debian.org>
---
 Makefile | 5 ++++-
 calc.man | 8 ++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 2084ff4..0cc6b31 100644
--- a/Makefile
+++ b/Makefile
@@ -510,6 +510,8 @@ libcalc${LIB_EXT_VER}: libcalc${LIB_EXT_VERSION}
 #
 ###
 
+# Note: The :\(...-sed pattern below allows word wrapping at the separators
+# of long path names (typically CALCPATH and CALCRC).
 calc.1: calc.man ${MK_SET}
 	${RM} -f $@
 	${Q} echo forming calc.1 from calc.man
@@ -523,7 +525,8 @@ calc.1: calc.man ${MK_SET}
 	        -e 's,$${CUSTOMINCDIR},${CUSTOMINCDIR},g' \
 	        -e 's,$${HELPDIR},${HELPDIR},g' \
 	        -e 's,$${CUSTOMHELPDIR},${CUSTOMHELPDIR},g' \
-	        -e 's,$${CALCRC},${CALCRC},g' < calc.man > calc.1
+	        -e 's,$${CALCRC},${CALCRC},g' \
+	        -e 's,:\([/.~]\),:\\:\1,g' < calc.man > calc.1
 	${Q} echo calc.1 formed
 
 calc.usage: calc.1 ${MK_SET}
diff --git a/calc.man b/calc.man
index 41f08cb..5775ebe 100644
--- a/calc.man
+++ b/calc.man
@@ -501,7 +501,7 @@ version number and exit.
 
 .TP
 .B \-\-
-The double dash indicates to calc that no more option follow.
+The double dash indicates to calc that no more options follow.
 Thus calc will ignore a later argument on the command line
 even if it starts with a dash.
 This is useful when entering negative values on the command line as in:
@@ -543,7 +543,7 @@ will not evaluate any
 arguments but instead make them available
 as strings to the argv() builtin function.
 
-Sufficiently simple commands with no no characters like
+Sufficiently simple commands with no characters like
 parentheses, brackets, semicolons, '*', which have special
 interpretations in UNIX shells may be entered, possibly with
 spaces, until the terminating newline.
@@ -804,7 +804,7 @@ the rest of the file will be processed in
 Note that
 .B \-s
 .B \-f
-must at the end of the initial ``#!'' line.
+must be at the end of the initial ``#!'' line.
 Any other optional
 .B "optional_other_flags"
 must come before
@@ -973,7 +973,7 @@ Before a variable is assigned a value it has the value of zero.
 .PP
 The scope of a variable may be global, local to a file, or local to a
 procedure.
-Values may be grouped together in a matrix, or into a
+Values may be grouped together in a matrix, or into
 a list that permits stack and queue style operations.
 .PP
 For more information use the following
