Also, back-patch fix into back branches.
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.65 2001/12/03 00:28:24 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.65.2.1 2005/07/08 15:25:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
if (!already_bound)
{
+ /* dgettext() preserves errno, but bindtextdomain() doesn't */
+ int save_errno = errno;
+
already_bound = 1;
bindtextdomain("libpq", LOCALEDIR);
+#ifdef WIN32
+ SetLastError(save_errno);
+#else
+ errno = save_errno;
+#endif
}
return dgettext("libpq", msgid);