ports/textproc/par/patches/patch-par_c

26 lines
532 B
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Index: par.c
--- par.c.orig
+++ par.c
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
+#include <unistd.h>
#undef NULL
#define NULL ((void *) 0)
@@ -730,6 +731,13 @@ int main(int argc, const char * const *argv)
/* Set the current locale from the environment: */
setlocale(LC_ALL,"");
+
+/* setlocale() needs "rpath", so do the syscall after it */
+
+ if (pledge("stdio", NULL) == -1) {
+ wcscpy(errmsg, L"pledge\n");
+ goto parcleanup;
+ }
/* Process environment variables: */