From c559a3ca84a0258e4773571ae73fa7bba4c927b0 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 25 Nov 1999 19:27:07 +0000 Subject: Update. 1999-11-25 H.J. Lu * stdlib/exit.c (exit): Run funtions only if __exit_funcs->idx > 0. 1999-11-25 Ulrich Drepper * manual/charset.texi (iconv Examples): Add iconv call to flush state. Reported by Andrew Clausen . 1999-11-25 Andreas Jaeger * manual/install.texi (Running make install): Better describe update from libc5. Patch by Michael Deutschmann . 1999-11-25 Andreas Jaeger * include/sys/mman.h: Remove K&R compatibility. 1999-11-15 Andreas Jaeger * misc/sys/mman.h: Use __REDIRECT for mmap, correct prototype to use __off64_t. 1999-11-25 Ulrich Drepper * iconv/iconv_prog.c (process_block): For stateful charsets write out byte sequence to get to initial state at the end of the file. which was reported to not work (which proofed to be wrong). --- manual/charset.texi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'manual/charset.texi') diff --git a/manual/charset.texi b/manual/charset.texi index 7a5237edfb..76b189f5fc 100644 --- a/manual/charset.texi +++ b/manual/charset.texi @@ -1837,6 +1837,11 @@ file2wcs (int fd, const char *charset, wchar_t *outbuf, size_t avail) @r{characters in the @code{inbuf}. Put them back.} */ if (lseek (fd, -insize, SEEK_CUR) == -1) result = -1; + + /* @r{Now write out the byte sequence to get into the} + @r{initial state if this is necessary.} */ + iconv (cd, NULL, NULL, &wrptr, &avail); + break; @} insize += nread; @@ -1867,7 +1872,8 @@ file2wcs (int fd, const char *charset, wchar_t *outbuf, size_t avail) @} /* @r{Terminate the output string.} */ - *((wchar_t *) wrptr) = L'\0'; + if (avail >= sizeof (wchar_t)) + *((wchar_t *) wrptr) = L'\0'; if (iconv_close (cd) != 0) perror ("iconv_close"); -- cgit 1.4.1