Blame SOURCES/recode.patch

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