Files
bsdports/system/squashfs-tools/files/patch-action.c
2019-12-26 07:26:06 +00:00

18 lines
370 B
C

Hack for lack of strdupa() in BSD libc
--- action.c.orig
+++ action.c
@@ -44,6 +44,12 @@
#include "action.h"
#include "error.h"
+#ifndef strdupa
+#include <string.h> // required for str*()
+#include <stdlib.h> // required for alloca
+#define strdupa(foo) (strncpy( alloca( strlen(foo) + 1 ), foo, strlen( foo ) + 1 ))
+#endif
+
/*
* code to parse actions
*/