groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 20/31: [nroff]: Improve portability.


From: G. Branden Robinson
Subject: [groff] 20/31: [nroff]: Improve portability.
Date: Sun, 25 Jul 2021 02:39:49 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 8ca88a9c72b59da7e8757b8f6012aef5947ef144
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Jul 24 12:17:32 2021 +1000

    [nroff]: Improve portability.
    
    * src/roff/nroff/nroff.sh: Use Version 7 Unix sh-compatible form of
      parameter expansion; per the GNU Autoconf manual[1], "[o]ld BSD
      shells, including the Ultrix sh, don't accept the colon for any shell
      substitution, and complain and die."  This is also the form of such
      substitutions used elsewhere in the script, so they should be mutually
      consistent.
    
    [1] https://www.gnu.org/software/autoconf/manual/autoconf-2.60/
        html_node/Shell-Substitutions.html
    
    Also add editor aid comments.
---
 ChangeLog               | 12 ++++++++++++
 src/roff/nroff/nroff.sh |  9 ++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1274c28..eb28086 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2021-07-23  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * src/roff/nroff/nroff.sh: Use Version 7 Unix sh-compatible form
+       of parameter expansion; per the GNU Autoconf manual[1], "[o]ld
+       BSD shells, including the Ultrix sh, don't accept the colon for
+       any shell substitution, and complain and die."  This is also the
+       form of such substitutions used elsewhere in the script, so they
+       should be mutually consistent.
+
+       [1] https://www.gnu.org/software/autoconf/manual/autoconf-2.60/\
+       html_node/Shell-Substitutions.html
+
+2021-07-23  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * src/roff/nroff/nroff.sh: Slightly refactor.  Rename formerly
        unused loop index variable from `i` to `arg` to leverage it in a
        later diagnostic message without a separate definition.  Inside
diff --git a/src/roff/nroff/nroff.sh b/src/roff/nroff/nroff.sh
index 951ad14..6c8ae85 100644
--- a/src/roff/nroff/nroff.sh
+++ b/src/roff/nroff/nroff.sh
@@ -156,8 +156,8 @@ opts="-mtty-char$opts"
 @GROFF_BIN_PATH_SETUP@
 export GROFF_BIN_PATH
 
-# Let the test cases redirect us.
-groff=${GROFF_TEST_GROFF:-groff}
+# Let our test harness redirect us.
+groff=${GROFF_TEST_GROFF-groff}
 
 # Note 1: It would be nice to apply the DRY ("Don't Repeat Yourself")
 # principle here and store the entire command string to be executed into
@@ -190,4 +190,7 @@ else
   PATH="$GROFF_RUNTIME$PATH" $groff $T $opts ${1+"$@"}
 fi
 
-# eof
+# Local Variables:
+# fill-column: 72
+# End:
+# vim: set autoindent expandtab shiftwidth=2 softtabstop=2 textwidth=72:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]