gbranden pushed a commit to branch master
in repository groff.

commit baaa601ed1da5ed2468af9ef758f4e58a77fc566
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Dec 23 15:59:46 2023 -0600

    [gdiffmk]: Replace obsolescent test(1) constructs.
    
    * contrib/gdiffmk/gdiffmk.sh (WouldClobber, main): Drop obsolescent (per
      POSIX) use of test(1)'s `-a` and `-o` operators.  See <https://pubs.\
      opengroup.org/onlinepubs/9699919799/utilities/test.html>.
---
 contrib/gdiffmk/ChangeLog  | 6 ++++++
 contrib/gdiffmk/gdiffmk.sh | 7 ++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/contrib/gdiffmk/ChangeLog b/contrib/gdiffmk/ChangeLog
index c9c14d005..b23a13203 100644
--- a/contrib/gdiffmk/ChangeLog
+++ b/contrib/gdiffmk/ChangeLog
@@ -1,3 +1,9 @@
+2023-12-23  G. Branden Robinson <[email protected]>
+
+       * gdiffmk.sh (WouldClobber, main): Drop obsolescent (per POSIX)
+       use of test(1)'s `-a` and `-o` operators.  See <https://pubs.\
+       opengroup.org/onlinepubs/9699919799/utilities/test.html>.
+
 2023-12-23  G. Branden Robinson <[email protected]>
 
        * gdiffmk.sh: Tweak output in error scenarios.  Add `want_help`
diff --git a/contrib/gdiffmk/gdiffmk.sh b/contrib/gdiffmk/gdiffmk.sh
index 41ca120df..b6791cff9 100644
--- a/contrib/gdiffmk/gdiffmk.sh
+++ b/contrib/gdiffmk/gdiffmk.sh
@@ -119,7 +119,8 @@ WouldClobber () {
        esac
 
        # BASH_PROG is set to /bin/sh if bash was not found
-       if test "$HAVE_TEST_EF_OPTION" = "no" -a "$BASH_PROG" = "/bin/sh"
+       if test "$HAVE_TEST_EF_OPTION" = "no" \
+               && test "$BASH_PROG" = "/bin/sh"
        then
                Exit 3 \
                "Your shell does support test -ef, [OUTPUT] can only be the" \
@@ -246,12 +247,12 @@ then
        Usage "${BADOPTION}"
 fi
 
-if test $# -lt 2  -o  $# -gt 3
+if test $# -lt 2 || test $# -gt 3
 then
        Usage "Incorrect number of arguments."
 fi
 
-if test "1$1" = "1-"  -a  "2$2" = "2-"
+if test "1$1" = "1-" && test "2$2" = "2-"
 then
        Usage "Both FILE1 and FILE2 are '-'."
 fi

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to