Fix a compilation error on HP-UX 11.00, introduced on 2008-09-16.
diff --git a/ChangeLog b/ChangeLog
index 89d3fb0..1dbfd51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-24 Bruno Haible <bruno@clisp.org>
+
+ Fix a compilation error on HP-UX 11.00, introduced on 2008-09-16.
+ * src/iconv_open2.h: Don't initialize nonexistent field if
+ !(HAVE_WCRTOMB || HAVE_MBRTOWC).
+ Patch by Joel Brobecker <brobecker@adacore.com>.
+
2009-04-15 Bruno Haible <bruno@clisp.org>
* src/Makefile.in (install, uninstall): Append the $(EXEEXT) suffix
diff --git a/lib/iconv_open2.h b/lib/iconv_open2.h
index e0b076f..6d6296f 100644
--- a/lib/iconv_open2.h
+++ b/lib/iconv_open2.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1999-2008 Free Software Foundation, Inc.
+ * Copyright (C) 1999-2009 Free Software Foundation, Inc.
* This file is part of the GNU LIBICONV Library.
*
* The GNU LIBICONV Library is free software; you can redistribute it
@@ -82,6 +82,8 @@
/* Initialize additional fields. */
if (from_wchar != to_wchar) {
struct wchar_conv_struct * wcd = (struct wchar_conv_struct *) cd;
+#if HAVE_WCRTOMB || HAVE_MBRTOWC
memset(&wcd->state,'\0',sizeof(mbstate_t));
+#endif
}
/* Done. */