[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 30/115: [pdfmark]: Don't emit redundant pdfhref Z records.
From: |
G. Branden Robinson |
Subject: |
[groff] 30/115: [pdfmark]: Don't emit redundant pdfhref Z records. |
Date: |
Thu, 1 Jun 2023 10:46:04 -0400 (EDT) |
gbranden pushed a commit to branch branden-2022-06-01
in repository groff.
commit 64e9c6101db0ec9aa1e47c3177ce7a22c34dd19e
Author: Keith Marshall <keith.d.marshall@ntlworld.com>
AuthorDate: Sat Feb 25 00:30:47 2023 +0000
[pdfmark]: Don't emit redundant pdfhref Z records.
* contrib/pdfmark/pdfroff.sh [grohtml-info] (pdfhref Z): Adapt awk
script, to emit...
(pdfhref Z 0 0 0): ...this conditionally, only if at least one prior
record has been emitted; delete unconditional emission, which caused
the anomaly reported as groff issue #63133.
Fixes <https://savannah.gnu.org/bugs/?63133>.
{merged from OSDN hg patch by GBR, 2023-04-07}
---
contrib/pdfmark/ChangeLog | 14 ++++++++++++++
contrib/pdfmark/pdfroff.sh | 20 ++++++++++----------
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/contrib/pdfmark/ChangeLog b/contrib/pdfmark/ChangeLog
index 1c5a18f50..6472426a2 100644
--- a/contrib/pdfmark/ChangeLog
+++ b/contrib/pdfmark/ChangeLog
@@ -1,3 +1,17 @@
+2023-02-24 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ Do not emit redundant 'pdfhref Z' records.
+
+ * pdfroff.sh [grohtml-info] (pdfhref Z): Adapt awk script, to
+ emit...
+ (pdfhref Z 0 0 0): ...this conditionally, only if at least one
+ prior record has been emitted; delete unconditional emission,
+ which caused the anomaly reported as groff issue #63133.
+
+ Fixes <https://savannah.gnu.org/bugs/?63133>.
+
+ {merged from OSDN hg patch by GBR, 2023-04-07}
+
2023-02-18 G. Branden Robinson <g.branden.robinson@gmail.com>
* pdfmark.am (uninstall-pdfmark-hook): Simplify uninstallation.
diff --git a/contrib/pdfmark/pdfroff.sh b/contrib/pdfmark/pdfroff.sh
index f34c841f6..6b6f5d711 100644
--- a/contrib/pdfmark/pdfroff.sh
+++ b/contrib/pdfmark/pdfroff.sh
@@ -577,16 +577,16 @@
fi
#
# We now extend the local copy of the reference dictionary file,
-# to create a full 'pdfmark' reference map for the document ...
+# to create a full 'pdfmark' reference map for the document; when
+# one or more reference marks has been mapped, append one further
+# dummy map reference, to ensure that at least one such is always
+# present; (this is required, to suppress any further intermediate
+# output to stderr during the "press-ready" runs of groff, for PDF
+# output file production).
#
- $AWK '/^grohtml-info/ {print ".pdfhref Z", $2, $3, $4}' $WRKFILE >> $REFCOPY
-#
-# ... appending a dummy map reference, to ensure that at least
-# one such is always present; (this is required, to suppress any
-# further intermediate output to stderr during the "press-ready"
-# runs of groff, for PDF output file production).
-#
- echo ".pdfhref Z 0 0 0" >> $REFCOPY
+ $AWK '/^grohtml-info/ {zflag = 1; print ".pdfhref Z", $2, $3, $4}
+ END {if(zflag) print ".pdfhref Z 0 0 0"}
+ ' $WRKFILE >> $REFCOPY
#
# Evaluate any processing options which may have been specified
# as a result of parsing the document source ...
@@ -609,7 +609,7 @@
#
# Re-enable progress reporting, if necessary ...
# (Missing 'awk' or 'diff' may have disabled it, to avoid display
-# of spurious messages associated with reference resolution).
+# of spurious messages associated with reference resolution).
#
test x${SHOW_PROGRESS+"set"} = x"set" && SAY=echo
#
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 30/115: [pdfmark]: Don't emit redundant pdfhref Z records.,
G. Branden Robinson <=