gbranden pushed a commit to branch master
in repository groff.
commit 42ad6e0ebefd719712f46a4971bbbc0622682f6a
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Jun 4 14:11:36 2022 -0500
[gropdf]: Do more "DESC" file validation.
* src/devices/gropdf/gropdf.pl: Do more "DESC" file validation.
(LoadDesc): Bomb out gracefully if any of "unitwidth", "res", or
"sizescale", missing from "DESC" file. This prevents Perl warnings
about use of unintialized values, and undoubtedly mangled output.
---
ChangeLog | 8 ++++++++
src/devices/gropdf/gropdf.pl | 6 ++++++
2 files changed, 14 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 3b125d21..c467f5d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-06-04 G. Branden Robinson <[email protected]>
+
+ * src/devices/gropdf/gropdf.pl: Do more "DESC" file validation.
+ (LoadDesc): Bomb out gracefully if any of "unitwidth", "res", or
+ "sizescale" missing from "DESC" file. This prevents Perl
+ warnings about use of unintialized values, and undoubtedly
+ mangled output.
+
2022-06-04 G. Branden Robinson <[email protected]>
* src/devices/gropdf/gropdf.pl: Revise diagnostic message
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index aef411e0..9002cd6e 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -683,6 +683,12 @@ sub LoadDesc
}
close($f);
+
+ foreach my $directive ('unitwidth', 'res', 'sizescale')
+ {
+ Die("device description file 'DESC' missing mandatory directive"
+ . " '$directive'") if !exists($desc{$directive});
+ }
}
sub rad { $_[0]*3.14159/180 }
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit