[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 03/03: Robustify GROFF_PAGE m4 macro against whitespace.
From: |
G. Branden Robinson |
Subject: |
[groff] 03/03: Robustify GROFF_PAGE m4 macro against whitespace. |
Date: |
Mon, 12 Nov 2018 12:50:03 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 821a6257b07fa6daade2c4ab5623275bc1014388
Author: G. Branden Robinson <address@hidden>
Date: Mon Nov 12 12:33:19 2018 -0500
Robustify GROFF_PAGE m4 macro against whitespace.
* m4/groff.m4 (GROFF_PAGE): Quote shell variables that are under
external control and may contain embedded whitespace. A test
shows that our configure script is now robust in this way, but
our Automake files are not, starting with
src/utils/afmtodit/afmtodit.am.
Signed-off-by: G. Branden Robinson <address@hidden>
---
ChangeLog | 8 ++++++++
m4/groff.m4 | 20 ++++++++++----------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b8fc025..c6c7b1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2018-11-12 G. Branden Robinson <address@hidden>
+ * m4/groff.m4 (GROFF_PAGE): Quote shell variables that are under
+ external control and may contain embedded whitespace. A test
+ shows that our configure script is now robust in this way, but
+ our Automake files are not, starting with
+ src/utils/afmtodit/afmtodit.am.
+
+2018-11-12 G. Branden Robinson <address@hidden>
+
* makevarescape.sed:
- Escape plain spaces and double-quotes (ASCII 32 and 34) so
that bad things don't happen if they are embedded in a Make
diff --git a/m4/groff.m4 b/m4/groff.m4
index 79aa095..13772dc 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -776,27 +776,27 @@ AC_DEFUN([GROFF_BROKEN_SPOOLER_FLAGS],
AC_DEFUN([GROFF_PAGE],
[AC_MSG_CHECKING([default paper size])
- groff_prefix=$prefix
+ groff_prefix="$prefix"
test "x$prefix" = "xNONE" && groff_prefix=$ac_default_prefix
if test -z "$PAGE"; then
descfile=
- if test -r $groff_prefix/share/groff/font/devps/DESC; then
- descfile=$groff_prefix/share/groff/font/devps/DESC
- elif test -r $groff_prefix/lib/groff/font/devps/DESC; then
- descfile=$groff_prefix/lib/groff/font/devps/DESC
+ if test -r "$groff_prefix"/share/groff/font/devps/DESC; then
+ descfile="$groff_prefix"/share/groff/font/devps/DESC
+ elif test -r "$groff_prefix"/lib/groff/font/devps/DESC; then
+ descfile="$groff_prefix"/lib/groff/font/devps/DESC
else
- for f in $groff_prefix/share/groff/*/font/devps/DESC; do
- if test -r $f; then
- descfile=$f
+ for f in "$groff_prefix"/share/groff/*/font/devps/DESC; do
+ if test -r "$f"; then
+ descfile="$f"
break
fi
done
fi
if test -n "$descfile"; then
- if grep ['^paperlength[ ]\+841890'] $descfile >/dev/null 2>&1; then
+ if grep ['^paperlength[ ]\+841890'] "$descfile" >/dev/null 2>&1; then
PAGE=A4
- elif grep ['^papersize[ ]\+[aA]4'] $descfile >/dev/null 2>&1; then
+ elif grep ['^papersize[ ]\+[aA]4'] "$descfile" >/dev/null 2>&1; then
PAGE=A4
fi
fi
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 03/03: Robustify GROFF_PAGE m4 macro against whitespace.,
G. Branden Robinson <=