ports/editors/tweak/patches/patch-main_c

26 lines
505 B
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
use pledge().
Index: main.c
--- main.c.orig
+++ main.c
@@ -173,6 +173,7 @@
#include <string.h>
#include <ctype.h>
#include <assert.h>
+#include <unistd.h>
#if defined(unix) && !defined(GO32)
#include <signal.h>
@@ -231,6 +232,11 @@ void usage(FILE *fp)
* Main program
*/
int main(int argc, char **argv) {
+ if (pledge("stdio rpath wpath cpath tty", NULL) == -1) {
+ fprintf(stderr, "pledge\n");
+ return 1;
+ }
+
fileoffset_t newoffset = -1, newwidth = -1;
/*