Line 0
Link Here
|
|
|
1 |
--- editors/vi.c 2008-11-09 17:28:21.000000000 +0000 |
2 |
+++ ../../../vi.c 2010-12-14 22:09:34.000000000 +0000 |
3 |
@@ -21,6 +21,30 @@ |
4 |
* An "ex" line oriented mode- maybe using "cmdedit" |
5 |
*/ |
6 |
|
7 |
+/* Test for existance of memrchr() */ |
8 |
+ |
9 |
+#if (__FreeBSD_version < 603103) || (__FreeBSD_version < 700109 && __FreeBSD_version >= 700000) || (__FreeBSD_version < 800034 && __FreeBSD_version >=800000) |
10 |
+static void * |
11 |
+memrchr(const void *buf, int c, size_t num) |
12 |
+{ |
13 |
+ unsigned char *pMem = (unsigned char *) buf; |
14 |
+ |
15 |
+ for (;;) { |
16 |
+ if (num-- == 0) { |
17 |
+ return NULL; |
18 |
+ } |
19 |
+ |
20 |
+ if (*pMem-- == (unsigned char) c) { |
21 |
+ break; |
22 |
+ } |
23 |
+ |
24 |
+ } |
25 |
+ |
26 |
+ return (void *) (pMem + 1); |
27 |
+ |
28 |
+} |
29 |
+#endif |
30 |
+ |
31 |
#include "libbb.h" |
32 |
|
33 |
/* the CRASHME code is unmaintained, and doesn't currently build */ |