From 1483e1168224e9d37ff0986ccf5e3346af7e9281 Mon Sep 17 00:00:00 2001 From: "G. Branden Robinson" Date: Fri, 21 Jan 2022 20:38:19 +1100 Subject: [pdfpic]: Fix Savannah #58206. * tmac/pdfpic.tmac (PDFPIC): Scrub null bytes out of pdfinfo(1) output. Thanks to an anonymous contributor for the patch (the commentary about it is mine, if someone wants an argument). Fixes . --- tmac/pdfpic.tmac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tmac/pdfpic.tmac') diff --git a/tmac/pdfpic.tmac b/tmac/pdfpic.tmac index c2159674b..46228fb69 100644 --- a/tmac/pdfpic.tmac +++ b/tmac/pdfpic.tmac @@ -118,9 +118,12 @@ . return . \} . -. \" get image dimensions +. \" Get image dimensions. The `tr` command to strip null bytes is +. \" distasteful, but its necessity is imposed on us. See +. \" . . ec @ . sy pdfinfo @$1 | \ +tr -d '\000' | \ grep "Page *size" | \ sed -e 's/Page *size: *\\([[:digit:].]*\\) *x *\\([[:digit:].]*\\).*$/\ .nr pdfpic*width (p;\\1)\\n\ -- cgit v1.2.1