Added yaz_iconv flush.
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 21 Mar 2007 08:37:57 +0000 (08:37 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 21 Mar 2007 08:37:57 +0000 (08:37 +0000)
util/yaziconv.c

index bf3b922..f91c60b 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2007, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: yaziconv.c,v 1.7 2007-03-09 08:39:38 adam Exp $
+ * $Id: yaziconv.c,v 1.8 2007-03-21 08:37:57 adam Exp $
  */
 
 #if HAVE_CONFIG_H
@@ -44,6 +44,11 @@ void convert (FILE *inf, yaz_iconv_t cd, int verbose)
                 {
                     if (outbuf != outbuf0)
                         fwrite (outbuf0, 1, outbuf - outbuf0, stdout);
+                    outbuf = outbuf0;
+                    outbytesleft = CHUNK_OUT;
+                    r = yaz_iconv (cd, 0, 0, &outbuf, &outbytesleft);
+                    if (outbuf != outbuf0)
+                        fwrite (outbuf0, 1, outbuf - outbuf0, stdout);
                     break;
                 }
                 inbytesleft = r;