man-db-2.8.5-iconv.patch 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. --- man-db-2.8.5/src/man.c 2018-06-18 22:44:35.672743065 -0500
  2. +++ man-db-2.8.5/src/man.c 2018-06-18 22:46:35.032624890 -0500
  3. @@ -1569,15 +1569,13 @@
  4. {
  5. debug ("add_output_iconv: source %s, target %s\n", source, target);
  6. if (source && target && !STREQ (source, target)) {
  7. - char *target_translit = xasprintf ("%s//TRANSLIT", target);
  8. pipecmd *iconv_cmd;
  9. iconv_cmd = pipecmd_new_args
  10. - ("iconv", "-c", "-f", source, "-t", target_translit,
  11. + ("iconv", "-c", "-f", source, "-t", target,
  12. (void *) 0);
  13. pipecmd_pre_exec (iconv_cmd, sandbox_load, sandbox_free,
  14. sandbox);
  15. pipeline_command (p, iconv_cmd);
  16. - free (target_translit);
  17. }
  18. }
  19. --- man-db-2.8.5/src/manconv.c
  20. +++ man-db-2.8.5/src/manconv.c
  21. @@ -106,10 +106,9 @@ static int try_iconv (pipeline *p, const char *try_from_code, const char *to,
  22. static char *utf8 = NULL, *output = NULL;
  23. size_t utf8left = 0;
  24. iconv_t cd_utf8, cd = NULL;
  25. - int to_utf8 = STREQ (try_to_code, "UTF-8") ||
  26. - STRNEQ (try_to_code, "UTF-8//", 7);
  27. - const char *utf8_target = last ? "UTF-8//IGNORE" : "UTF-8";
  28. - int ignore_errors = (strstr (try_to_code, "//IGNORE") != NULL);;
  29. + int to_utf8 = STREQ (try_to_code, "UTF-8");
  30. + const char *utf8_target = "UTF-8";
  31. + int ignore_errors = 0;
  32. int ret = 0;
  33. debug ("trying encoding %s -> %s\n", try_from_code, try_to_code);
  34. --- man-db-2.8.5/src/manconv_client.c
  35. +++ man-db-2.8.5/src/manconv_client.c
  36. @@ -105,7 +105,7 @@ void add_manconv (pipeline *p, const char *source, const char *target)
  37. codes->from[2] = NULL;
  38. name = appendstr (name, "UTF-8:", source, (void *) 0);
  39. }
  40. - codes->to = xasprintf ("%s//IGNORE", target);
  41. + codes->to = xstrdup (target);
  42. /* informational only; no shell quoting concerns */
  43. name = appendstr (name, " -t ", codes->to, (void *) 0);
  44. if (quiet >= 2)
  45. --- man-db-2.8.5/src/manconv_main.c
  46. +++ man-db-2.8.5/src/manconv_main.c
  47. @@ -106,9 +106,6 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state)
  48. return 0;
  49. case 't':
  50. to_code = xstrdup (arg);
  51. - if (!strstr (to_code, "//"))
  52. - to_code = appendstr (to_code, "//TRANSLIT",
  53. - (void *) 0);
  54. return 0;
  55. case 'd':
  56. debug_level = 1;
  57. --- man-db-2.8.5/src/whatis.c
  58. +++ man-db-2.8.5/src/whatis.c
  59. @@ -974,7 +974,7 @@ int main (int argc, char *argv[])
  60. display_seen = hashtable_create (&null_hashtable_free);
  61. #ifdef HAVE_ICONV
  62. - locale_charset = xasprintf ("%s//IGNORE", get_locale_charset ());
  63. + locale_charset = xstrdup (get_locale_charset ());
  64. conv_to_locale = iconv_open (locale_charset, "UTF-8");
  65. free (locale_charset);
  66. #endif /* HAVE_ICONV */