blob: a5732dc6709dfe4a4524840f73c4ef88cacda136 (
plain) (
blame)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 | Hack for lack of strdupa() in BSD libc
$FreeBSD$
--- 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
  */
 |