shithub: neatroff

Download patch

ref: cbd9d00535e798af19bc2186707cc9b5b39c4158
parent: cb8e5ddf8f87b1cea61d6603847b9fa7773089f1
author: Ali Gholami Rudi <ali@rudi.ir>
date: Fri Aug 1 17:55:43 EDT 2014

dev: the third argument of .fp can be a path

If the third argument of .fp request contains a slash, neatroff
assumes that it is the path of the font description file.  Otherwise,
as before, the font is looked up in the output device directory.

--- a/dev.c
+++ b/dev.c
@@ -43,7 +43,10 @@
 	struct font *fn;
 	if (pos >= NFONTS)
 		return -1;
-	sprintf(path, "%s/dev%s/%s", dev_dir, dev_dev, name);
+	if (strchr(name, '/'))
+		strcpy(path, name);
+	else
+		sprintf(path, "%s/dev%s/%s", dev_dir, dev_dev, name);
 	fn = font_open(path);
 	if (!fn)
 		return -1;