shithub: neatpost

Download patch

ref: 5e6396ef72ed72ebc3ad0c2429c29066f74cd5d9
parent: 2bd5185e9784805eb1d2059a72e37cd4fa3b1cd4
author: Ali Gholami Rudi <ali@rudi.ir>
date: Thu Jun 26 21:42:58 EDT 2014

post: rename devname to postdev

devname() is a stdlib.h function in OpenBSD, causing compile-time
errors.  Reported by peters@schwertfisch.de.

--- a/post.c
+++ b/post.c
@@ -215,8 +215,8 @@
 		drawmend(arg);
 }
 
-static char devpath[PATHLEN] = TROFFFDIR;
-static char devname[PATHLEN] = "utf";
+static char postdir[PATHLEN] = TROFFFDIR;	/* output device directory */
+static char postdev[PATHLEN] = "utf";		/* output device name */
 
 static void postx(void)
 {
@@ -232,14 +232,14 @@
 		outmnt(pos);
 		break;
 	case 'i':
-		if (dev_open(devpath, devname)) {
-			fprintf(stderr, "neatpost: cannot open device %s\n", devname);
+		if (dev_open(postdir, postdev)) {
+			fprintf(stderr, "neatpost: cannot open device %s\n", postdev);
 			exit(1);
 		}
 		ps_header(ps_pagewidth, ps_pageheight, ps_linewidth);
 		break;
 	case 'T':
-		nextword(devname);
+		nextword(postdev);
 		break;
 	case 's':
 		break;
@@ -389,7 +389,7 @@
 	int i;
 	for (i = 1; i < argc; i++) {
 		if (argv[i][0] == '-' && argv[i][1] == 'F') {
-			strcpy(devpath, argv[i][2] ? argv[i] + 2 : argv[++i]);
+			strcpy(postdir, argv[i][2] ? argv[i] + 2 : argv[++i]);
 		} else if (argv[i][0] == '-' && argv[i][1] == 'p') {
 			setpagesize(argv[i][2] ? argv[i] + 2 : argv[++i]);
 		} else if (argv[i][0] == '-' && argv[i][1] == 'w') {