gbranden pushed a commit to branch master
in repository groff.
commit 0f2e7b537f4fbfc1f1a209bdc441f570ca7bdee1
Author: Johannes Altmanninger <[email protected]>
AuthorDate: Fri Apr 3 13:40:49 2026 +0800
Fix Savannah #68212.
* contrib/eqn2graph/eqn2graph.sh:
* contrib/grap2graph/grap2graph.sh:
* contrib/pic2graph/pic2graph.sh:
* src/preproc/eqn/neqn.sh:
* src/roff/nroff/nroff.sh: Use a subshell instead of the user's login
shell `$SHELL` to evaluate features of the running shell. The login
shell need not be a POSIX shell script interpreter; it could be
tcsh(1), rc(1), fish(1), or something exotic.
* src/roff/nroff/nroff.sh: Update fatal error diagnostic accordingly.
Fixes <https://savannah.gnu.org/bugs/?68212>. [Problem
introduced by me in commit c34c6cc58c, 2024-12-07. --GBR]
---
ChangeLog | 13 +++++++++++++
contrib/eqn2graph/eqn2graph.sh | 5 +----
contrib/grap2graph/grap2graph.sh | 5 +----
contrib/pic2graph/pic2graph.sh | 5 +----
src/preproc/eqn/neqn.sh | 5 +----
src/roff/nroff/nroff.sh | 9 ++-------
6 files changed, 19 insertions(+), 23 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index daf048a32..ae4e9b8e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2026-04-03 Johannes Altmanninger <[email protected]>
+
+ * src/preproc/eqn/neqn.sh:
+ * src/roff/nroff/nroff.sh: Use a subshell instead of the user's
+ login shell `$SHELL` to evaluate features of the running shell.
+ The login shell need not be a POSIX shell script interpreter; it
+ could be tcsh(1), rc(1), fish(1), or something exotic.
+ * src/roff/nroff/nroff.sh: Update fatal error diagnostic
+ accordingly.
+
+ Fixes <https://savannah.gnu.org/bugs/?68212>. [Problem
+ introduced by me in commit c34c6cc58c, 2024-12-07. --GBR]
+
2026-04-03 G. Branden Robinson <[email protected]>
* src/roff/groff/groff.cpp (xstrdup):
diff --git a/contrib/eqn2graph/eqn2graph.sh b/contrib/eqn2graph/eqn2graph.sh
index 8f6f5c9f7..922bbb969 100644
--- a/contrib/eqn2graph/eqn2graph.sh
+++ b/contrib/eqn2graph/eqn2graph.sh
@@ -35,10 +35,7 @@ badshell=yes
# Solaris 10 /bin/sh is so wretched that it not only doesn't support
# standard parameter expansion, but it also writes diagnostic messages
# to the standard output instead of standard error.
-if [ -n "$SHELL" ]
-then
- "$SHELL" -c 'prog=${0##*/}' >/dev/null 2>&1 && badshell=
-fi
+(prog=${0##*/}) >/dev/null 2>&1 && badshell=
if [ -n "$badshell" ]
then
diff --git a/contrib/grap2graph/grap2graph.sh b/contrib/grap2graph/grap2graph.sh
index cda70b1ab..274715d1d 100644
--- a/contrib/grap2graph/grap2graph.sh
+++ b/contrib/grap2graph/grap2graph.sh
@@ -34,10 +34,7 @@ badshell=yes
# Solaris 10 /bin/sh is so wretched that it not only doesn't support
# standard parameter expansion, but it also writes diagnostic messages
# to the standard output instead of standard error.
-if [ -n "$SHELL" ]
-then
- "$SHELL" -c 'prog=${0##*/}' >/dev/null 2>&1 && badshell=
-fi
+(prog=${0##*/}) >/dev/null 2>&1 && badshell=
if [ -n "$badshell" ]
then
diff --git a/contrib/pic2graph/pic2graph.sh b/contrib/pic2graph/pic2graph.sh
index 6edf80002..d760bfc20 100644
--- a/contrib/pic2graph/pic2graph.sh
+++ b/contrib/pic2graph/pic2graph.sh
@@ -41,10 +41,7 @@ badshell=yes
# Solaris 10 /bin/sh is so wretched that it not only doesn't support
# standard parameter expansion, but it also writes diagnostic messages
# to the standard output instead of standard error.
-if [ -n "$SHELL" ]
-then
- "$SHELL" -c 'prog=${0##*/}' >/dev/null 2>&1 && badshell=
-fi
+(prog=${0##*/}) >/dev/null 2>&1 && badshell=
if [ -n "$badshell" ]
then
diff --git a/src/preproc/eqn/neqn.sh b/src/preproc/eqn/neqn.sh
index 12864a6eb..e220cb37a 100644
--- a/src/preproc/eqn/neqn.sh
+++ b/src/preproc/eqn/neqn.sh
@@ -24,10 +24,7 @@ badshell=yes
# Solaris 10 /bin/sh is so wretched that it not only doesn't support
# standard parameter expansion, but it also writes diagnostic messages
# to the standard output instead of standard error.
-if [ -n "$SHELL" ]
-then
- "$SHELL" -c 'prog=${0##*/}' >/dev/null 2>&1 && badshell=
-fi
+(prog=${0##*/}) >/dev/null 2>&1 && badshell=
if [ -n "$badshell" ]
then
diff --git a/src/roff/nroff/nroff.sh b/src/roff/nroff/nroff.sh
index e2f06babd..6f7c29aa0 100644
--- a/src/roff/nroff/nroff.sh
+++ b/src/roff/nroff/nroff.sh
@@ -27,10 +27,7 @@ badshell=yes
# Solaris 10 /bin/sh is so wretched that it not only doesn't support
# standard parameter expansion, but it also writes diagnostic messages
# to the standard output instead of standard error.
-if [ -n "$SHELL" ]
-then
- "$SHELL" -c 'prog=${0##*/}' >/dev/null 2>&1 && badshell=
-fi
+(prog=${0##*/}) >/dev/null 2>&1 && badshell=
if [ -n "$badshell" ]
then
@@ -73,10 +70,8 @@ do
-[abCEikpRStUvzZ]*)
if test -n "$badshell"
then
- # POSIX doesn't actually require $SHELL, but fortunately at
- # least one craptastic non-conforming shell offers it.
echo "$prog: option cluster '$thisarg' not supported with" \
- "POSIX-non-conforming shell '$SHELL'" >&2
+ "POSIX-non-conforming shell" >&2
exit 2
fi
remainder=${thisarg#-?}
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit