1
0

100-b64_ntop-conflict.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. diff --git a/compat.h b/compat.h
  2. index 8666a1d..2a44a2b 100644
  3. --- a/compat.h
  4. +++ b/compat.h
  5. @@ -223,7 +223,9 @@ int daemon(int, int);
  6. #ifndef HAVE_B64_NTOP
  7. /* b64_ntop.c */
  8. #undef b64_ntop /* for Cygwin */
  9. -int b64_ntop(const char *, size_t, char *, size_t);
  10. +int local_b64_ntop(const char *, size_t, char *, size_t);
  11. +#else
  12. +#define local_b64_ntop b64_ntop
  13. #endif
  14. #ifndef HAVE_FORKPTY
  15. diff --git a/compat/b64_ntop.c b/compat/b64_ntop.c
  16. index 2b4dc2d..a1314ca 100644
  17. --- a/compat/b64_ntop.c
  18. +++ b/compat/b64_ntop.c
  19. @@ -122,7 +122,7 @@ static const char Pad64 = '=';
  20. */
  21. int
  22. -b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) {
  23. +local_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) {
  24. size_t datalength = 0;
  25. uint8_t input[3];
  26. uint8_t output[4];
  27. diff --git a/tty.c b/tty.c
  28. index 7be952c..06dedab 100644
  29. --- a/tty.c
  30. +++ b/tty.c
  31. @@ -1134,7 +1134,7 @@ tty_cmd_setselection(struct tty *tty, const struct tty_ctx *ctx)
  32. off = 4 * ((ctx->num + 2) / 3) + 1; /* storage for base64 */
  33. buf = xmalloc(off);
  34. - b64_ntop(ctx->ptr, ctx->num, buf, off);
  35. + local_b64_ntop(ctx->ptr, ctx->num, buf, off);
  36. tty_putcode_ptr2(tty, TTYC_MS, "", buf);
  37. free(buf);