File: 005_use_system_strnlen.patch

package info (click to toggle)
arj 3.10.22-24
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,832 kB
  • sloc: ansic: 33,001; makefile: 1,999; sh: 1,587; asm: 436
file content (55 lines) | stat: -rw-r--r-- 1,481 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Description: Detect and conditionally use system strnlen function.
 This fixes build failures when the system has eglibc 2.10.
Author: Guillem Jover <guillem@debian.org>
Origin: vendor
Bug-Debian: https://bugs.debian.org/546475
Forwarded: no
Last-Update: 2009-09-13

---
 fardata.c        |    2 ++
 gnu/config.h.in  |    1 +
 gnu/configure.in |    4 +++-
 3 files changed, 6 insertions(+), 1 deletion(-)

--- a/fardata.c
+++ b/fardata.c
@@ -190,6 +190,7 @@ int msg_sprintf(char *str, FMSG *fmt, ..
 
 /* Length-limited strlen() */
 
+#ifndef HAVE_STRNLEN
 static int strnlen(const char FAR *s, int count)
 {
  const char FAR *sc;
@@ -198,6 +199,7 @@ static int strnlen(const char FAR *s, in
   ;
  return(sc-s);
 }
+#endif
 
 /* Hex representation of digits */
 
--- a/gnu/config.h.in
+++ b/gnu/config.h.in
@@ -8,6 +8,7 @@
 #undef HAVE_FCLOSEALL
 #undef HAVE_SETPRIORITY
 #undef HAVE_STRCASECMP
+#undef HAVE_STRNLEN
 #undef HAVE_STRUPR
 #undef HAVE_STRLWR
 #undef USE_COLORS
--- a/gnu/configure.in
+++ b/gnu/configure.in
@@ -35,7 +35,9 @@ AC_FUNC_MEMCMP
 AC_FUNC_SETVBUF_REVERSED
 AC_TYPE_SIGNAL
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([getcwd min max mkdir mkdtemp rmdir fcloseall strcasecmp setpriority strdup strerror strstr strupr strlwr strtol strtoul])
+AC_CHECK_FUNCS([getcwd min max mkdir mkdtemp rmdir fcloseall \
+                strcasecmp setpriority strdup strerror strstr strnlen \
+                strupr strlwr strtol strtoul])
 
 dnl Platform-specific tuning
 PROG_EXT=