recode.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. --- recode-3.6.orig/src/libiconv.c
  2. +++ recode-3.6/src/libiconv.c
  3. @@ -1,5 +1,5 @@
  4. /* Conversion of files between different charsets and surfaces.
  5. - Copyright © 1999, 2000 Free Software Foundation, Inc.
  6. + Copyright © 1999, 2000, 2001 Free Software Foundation, Inc.
  7. Contributed by François Pinard <pinard@iro.umontreal.ca>, 1999,
  8. and Bruno Haible <haible@clisp.cons.org>, 2000.
  9. @@ -195,12 +195,17 @@
  10. memcpy() doesn't do here, because the regions might overlap.
  11. memmove() isn't worth it, because we rarely have to move more
  12. than 12 bytes. */
  13. - if (input > input_buffer && input_left > 0)
  14. + cursor = input_buffer;
  15. + if (input_left > 0)
  16. {
  17. - cursor = input_buffer;
  18. - do
  19. - *cursor++ = *input++;
  20. - while (--input_left > 0);
  21. + if (input > input_buffer)
  22. + {
  23. + do
  24. + *cursor++ = *input++;
  25. + while (--input_left > 0);
  26. + }
  27. + else
  28. + cursor += input_left;
  29. }
  30. }
  31. --- recode-3.6.orig/src/request.c
  32. +++ recode-3.6/src/request.c
  33. @@ -1073,7 +1073,7 @@
  34. if (task->output.cursor + 4 >= task->output.limit)
  35. {
  36. RECODE_OUTER outer = task->request->outer;
  37. - size_t old_size = task->output.limit - task->output.buffer;
  38. + size_t old_size = task->output.cursor - task->output.buffer;
  39. size_t new_size = task->output.cursor + 4 - task->output.buffer;
  40. /* FIXME: Rethink about how the error should be reported. */
  41. --- recode-3.6.orig/src/task.c
  42. +++ recode-3.6/src/task.c
  43. @@ -1198,6 +1198,8 @@
  44. else
  45. success = transform_mere_copy (subtask);
  46. + task->output = subtask->output;
  47. +
  48. if (subtask->input.name && *subtask->input.name)
  49. fclose (subtask->input.file);
  50. if (subtask->output.name && *subtask->output.name)
  51. --- recode-3.6.orig/src/hash.h
  52. +++ recode-3.6/src/hash.h
  53. @@ -21,6 +21,11 @@
  54. /* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
  55. obstacks instead of malloc, and recompile `hash.c' with same setting. */
  56. +#define hash_lookup recode_hash_lookup
  57. +#define hash_delete recode_hash_delete
  58. +#define hash_free recode_hash_free
  59. +#define hash_insert recode_hash_insert
  60. +
  61. #ifndef PARAMS
  62. # if PROTOTYPES || __STDC__
  63. # define PARAMS(Args) Args