5cd1d43
--- recode-3.6.orig/src/libiconv.c
5cd1d43
+++ recode-3.6/src/libiconv.c
5cd1d43
@@ -1,5 +1,5 @@
5cd1d43
 /* Conversion of files between different charsets and surfaces.
5cd1d43
-   Copyright © 1999, 2000 Free Software Foundation, Inc.
5cd1d43
+   Copyright © 1999, 2000, 2001 Free Software Foundation, Inc.
5cd1d43
    Contributed by François Pinard <pinard@iro.umontreal.ca>, 1999,
5cd1d43
    and Bruno Haible <haible@clisp.cons.org>, 2000.
5cd1d43
 
5cd1d43
@@ -195,12 +195,17 @@
5cd1d43
 	 memcpy() doesn't do here, because the regions might overlap.
5cd1d43
 	 memmove() isn't worth it, because we rarely have to move more
5cd1d43
 	 than 12 bytes.  */
5cd1d43
-      if (input > input_buffer && input_left > 0)
5cd1d43
+      cursor = input_buffer;
5cd1d43
+      if (input_left > 0)
5cd1d43
 	{
5cd1d43
-	  cursor = input_buffer;
5cd1d43
-	  do
5cd1d43
-	    *cursor++ = *input++;
5cd1d43
-	  while (--input_left > 0);
5cd1d43
+	  if (input > input_buffer)
5cd1d43
+	    {
5cd1d43
+	      do
5cd1d43
+		*cursor++ = *input++;
5cd1d43
+	      while (--input_left > 0);
5cd1d43
+	    }
5cd1d43
+	  else
5cd1d43
+	    cursor += input_left;
5cd1d43
 	}
5cd1d43
     }
5cd1d43
 
5cd1d43
--- recode-3.6.orig/src/request.c
5cd1d43
+++ recode-3.6/src/request.c
5cd1d43
@@ -1073,7 +1073,7 @@
5cd1d43
   if (task->output.cursor + 4 >= task->output.limit)
5cd1d43
     {
5cd1d43
       RECODE_OUTER outer = task->request->outer;
5cd1d43
-      size_t old_size = task->output.limit - task->output.buffer;
5cd1d43
+      size_t old_size = task->output.cursor - task->output.buffer;
5cd1d43
       size_t new_size = task->output.cursor + 4 - task->output.buffer;
5cd1d43
 
5cd1d43
       /* FIXME: Rethink about how the error should be reported.  */
5cd1d43
--- recode-3.6.orig/src/task.c
5cd1d43
+++ recode-3.6/src/task.c
5cd1d43
@@ -1198,6 +1198,8 @@
5cd1d43
       else
5cd1d43
 	success = transform_mere_copy (subtask);
5cd1d43
 
5cd1d43
+      task->output = subtask->output;
5cd1d43
+       
5cd1d43
       if (subtask->input.name && *subtask->input.name)
5cd1d43
 	fclose (subtask->input.file);
5cd1d43
       if (subtask->output.name && *subtask->output.name)
5cd1d43
--- recode-3.6.orig/src/hash.h
5cd1d43
+++ recode-3.6/src/hash.h
5cd1d43
@@ -21,6 +21,11 @@
5cd1d43
 /* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
5cd1d43
    obstacks instead of malloc, and recompile `hash.c' with same setting.  */
5cd1d43
 
5cd1d43
+#define hash_lookup recode_hash_lookup
5cd1d43
+#define hash_delete recode_hash_delete
5cd1d43
+#define hash_free   recode_hash_free
5cd1d43
+#define hash_insert recode_hash_insert
5cd1d43
+
5cd1d43
 #ifndef PARAMS
5cd1d43
 # if PROTOTYPES || __STDC__
5cd1d43
 #  define PARAMS(Args) Args