shithub: neatroff

Download patch

ref: ae93e5a896bb530f4b4d18dba1ebb53cb8bb640b
parent: a7cb7b9b9f178c916713036a1248820336ca104b
author: Ali Gholami Rudi <ali@rudi.ir>
date: Fri Aug 8 13:38:59 EDT 2014

ren: allow scale indicators for arguments of .ps

Some old macro packages use ".ps 10p" instead of ".ps 10".

--- a/ren.c
+++ b/ren.c
@@ -493,9 +493,10 @@
 
 static void ren_ps(char *s)
 {
-	int ps = !s || !*s || !strcmp("0", s) ? n_s0 : eval_re(s, n_s, 0);
+	int ps = !s || !*s || !strcmp("0", s) ?
+		n_s0 * SC_PT : eval_re(s, n_s * SC_PT, 'p');
 	n_s0 = n_s;
-	n_s = MAX(1, ps);
+	n_s = MAX(1, (ps + SC_PT / 2) / SC_PT);
 }
 
 void tr_ps(char **args)