diffutils-2.8.1-__mempcpy.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. [PATCH] diffutils: Don't use glibc specific __mempcpy
  2. The configure script checks for mempcpy, but the code uses the (glibc
  3. specific) __mempcpy instead. Fix it to use mempcpy which is more
  4. portable.
  5. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>x
  6. ---
  7. lib/getopt.c | 4 ++--
  8. lib/regex.c | 2 +-
  9. 2 files changed, 3 insertions(+), 3 deletions(-)
  10. Index: diffutils-2.8.1/lib/getopt.c
  11. ===================================================================
  12. --- diffutils-2.8.1.orig/lib/getopt.c
  13. +++ diffutils-2.8.1/lib/getopt.c
  14. @@ -334,7 +334,7 @@ exchange (argv)
  15. nonoption_flags_len = nonoption_flags_max_len = 0;
  16. else
  17. {
  18. - memset (__mempcpy (new_str, __getopt_nonoption_flags,
  19. + memset (mempcpy (new_str, __getopt_nonoption_flags,
  20. nonoption_flags_max_len),
  21. '\0', top + 1 - nonoption_flags_max_len);
  22. nonoption_flags_max_len = top + 1;
  23. @@ -445,7 +445,7 @@ _getopt_initialize (argc, argv, optstrin
  24. if (__getopt_nonoption_flags == NULL)
  25. nonoption_flags_max_len = -1;
  26. else
  27. - memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
  28. + memset (mempcpy (__getopt_nonoption_flags, orig_str, len),
  29. '\0', nonoption_flags_max_len - len);
  30. }
  31. }
  32. Index: diffutils-2.8.1/lib/regex.c
  33. ===================================================================
  34. --- diffutils-2.8.1.orig/lib/regex.c
  35. +++ diffutils-2.8.1/lib/regex.c
  36. @@ -8314,7 +8314,7 @@ regerror (errcode, preg, errbuf, errbuf_
  37. if (msg_size > errbuf_size)
  38. {
  39. #if defined HAVE_MEMPCPY || defined _LIBC
  40. - *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
  41. + *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
  42. #else
  43. memcpy (errbuf, msg, errbuf_size - 1);
  44. errbuf[errbuf_size - 1] = 0;