shithub: neatroff

Download patch

ref: 0d691c38d6f30f1acaf8c2d2c710ad0648208c4b
parent: ab1be40cf7c539cb62f7bfb6537f8e1d96460ee5
author: aabacchus <bvnfuller@gmail.com>
date: Sun May 22 18:54:31 EDT 2022

roff: print usage to stderr and return 1 on bad options

so that if an incorrect option is given in a pipeline, the error message can be seen.

--- a/roff.c
+++ b/roff.c
@@ -133,8 +133,8 @@
 			dev = argv[i][2] ? argv[i] + 2 : argv[++i];
 			break;
 		default:
-			printf("%s", usage);
-			return 0;
+			fprintf(stderr, "%s", usage);
+			return 1;
 		}
 	}
 	if (dev_open(fontdir, dev)) {