summaryrefslogtreecommitdiff
path: root/filesystems/squashfs-tools/files/patch-action.c
blob: 2c07b6980c84409ff0483ecb65f39de7054eb7b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Hack for lack of strdupa() in BSD libc

--- action.c.orig	2014-05-10 04:54:13 UTC
+++ 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
  */