Blame SOURCES/0001-Recognize-fractional-numbers-in-PageSize.patch

07b5ee
From 75de02d9065b6280482d7cd011e9462badb19f83 Mon Sep 17 00:00:00 2001
07b5ee
From: Andreas Gruenbacher <agruenba@redhat.com>
07b5ee
Date: Thu, 30 Jan 2020 23:08:23 +0100
07b5ee
Subject: [PATCH] Recognize fractional numbers in PageSize
07b5ee
07b5ee
Right now, fractional numbers (fractional pt sizes) aren't allowed in
07b5ee
PageSize values even though they are perfectly fine in PPD files.  In
07b5ee
contrast, the values foomatic puts into the *ImageableArea and
07b5ee
*PaperDimension definitions it generates are fractional.  So allow
07b5ee
fractional numbers in PageSize values as well.
07b5ee
---
07b5ee
 lib/Foomatic/DB.pm | 6 +++---
07b5ee
 1 file changed, 3 insertions(+), 3 deletions(-)
07b5ee
07b5ee
diff --git a/lib/Foomatic/DB.pm b/lib/Foomatic/DB.pm
07b5ee
index 90389b3..39739aa 100644
07b5ee
--- a/lib/Foomatic/DB.pm
07b5ee
+++ b/lib/Foomatic/DB.pm
07b5ee
@@ -5533,7 +5533,7 @@ sub getppd (  $ $ $ ) {
07b5ee
 			# option.
07b5ee
 			my $size = $v->{'driverval'};
07b5ee
 			if ($size =~ /([\d\.]+)x([\d\.]+)([a-z]+)\b/) {
07b5ee
-			    # 2 positive integers separated by 
07b5ee
+			    # 2 positive numbers separated by
07b5ee
 			    # an 'x' with a unit
07b5ee
 			    my $w = $1;
07b5ee
 			    my $h = $2;
07b5ee
@@ -5551,8 +5551,8 @@ sub getppd (  $ $ $ ) {
07b5ee
 			    $w = sprintf("%.2f", $w) if $w =~ /\./;
07b5ee
 			    $h = sprintf("%.2f", $h) if $h =~ /\./;
07b5ee
 			    $size = "$w $h";
07b5ee
-			} elsif (($size =~ /(\d+)[x\s]+(\d+)/) ||
07b5ee
-			    # 2 positive integers separated by 
07b5ee
+			} elsif (($size =~ /([\d\.]+)[x\s]+([\d\.]+)/) ||
07b5ee
+			    # 2 positive numbers separated by
07b5ee
 			    # whitespace or an 'x'
07b5ee
 				 ($size =~ /\-dDEVICEWIDTHPOINTS\=(\d+)\s+\-dDEVICEHEIGHTPOINTS\=(\d+)/)) {
07b5ee
 			    # "-dDEVICEWIDTHPOINTS=..."/"-dDEVICEHEIGHTPOINTS=..."
07b5ee
-- 
07b5ee
2.25.4
07b5ee