summaryrefslogtreecommitdiffstats
path: root/roff.c
diff options
context:
space:
mode:
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/roff.c b/roff.c
index 435b0bfc..a17d168f 100644
--- a/roff.c
+++ b/roff.c
@@ -1641,8 +1641,46 @@ roff_getnum(const char *v, int *pos, int *res)
if (n)
*res = -*res;
- *pos = p;
- return 1;
+ /* Each number may be followed by one optional scaling unit. */
+
+ switch (v[p]) {
+ case 'f':
+ *res *= 65536;
+ break;
+ case 'i':
+ *res *= 240;
+ break;
+ case 'c':
+ *res *= 240;
+ *res /= 2.54;
+ break;
+ case 'v':
+ /* FALLTROUGH */
+ case 'P':
+ *res *= 40;
+ break;
+ case 'm':
+ /* FALLTROUGH */
+ case 'n':
+ *res *= 24;
+ break;
+ case 'p':
+ *res *= 10;
+ *res /= 3;
+ break;
+ case 'u':
+ break;
+ case 'M':
+ *res *= 6;
+ *res /= 25;
+ break;
+ default:
+ p--;
+ break;
+ }
+
+ *pos = p + 1;
+ return(1);
}
/*