From 20740446aa5580c1f6b852a87d29e338b7b1d4e8 Mon Sep 17 00:00:00 2001 From: Maxim Sobolev Date: Wed, 22 Aug 2001 18:41:46 +0000 Subject: Don't use nl_langinfo() - this interface doesn't exist in 4-stable. Reported by: Jose M. Alcaide --- news/pan/files/patch-gmime::gmime-utils.c | 31 +++++++++++++++++++++++++ news/pan/files/patch-pan::message-send.c | 36 ++++++++++++++++++++++++++++++ news/pan2/files/patch-gmime::gmime-utils.c | 31 +++++++++++++++++++++++++ news/pan2/files/patch-pan::message-send.c | 36 ++++++++++++++++++++++++++++++ 4 files changed, 134 insertions(+) create mode 100644 news/pan/files/patch-gmime::gmime-utils.c create mode 100644 news/pan/files/patch-pan::message-send.c create mode 100644 news/pan2/files/patch-gmime::gmime-utils.c create mode 100644 news/pan2/files/patch-pan::message-send.c diff --git a/news/pan/files/patch-gmime::gmime-utils.c b/news/pan/files/patch-gmime::gmime-utils.c new file mode 100644 index 000000000000..95e92d4731f6 --- /dev/null +++ b/news/pan/files/patch-gmime::gmime-utils.c @@ -0,0 +1,31 @@ + +$FreeBSD$ + +--- gmime/gmime-utils.c 2001/08/22 18:22:18 1.1 ++++ gmime/gmime-utils.c 2001/08/22 18:35:26 +@@ -32,7 +32,7 @@ + #include + #include + #include +-#include ++#include + + #define d(x) + +@@ -128,11 +128,12 @@ + get_codeset (void) + { + const gchar * codeset; ++ gchar *s; + +- codeset = nl_langinfo (CODESET); +- if (!codeset || !*codeset) +- codeset = DEFAULT_CODESET; +- ++ codeset = DEFAULT_CODESET; ++ if ((s = setlocale(LC_CTYPE, NULL)) != NULL) ++ if ((s = strchr(s, '.')) != NULL) ++ codeset = s + 1; + return codeset; + } + diff --git a/news/pan/files/patch-pan::message-send.c b/news/pan/files/patch-pan::message-send.c new file mode 100644 index 000000000000..05816edf0e70 --- /dev/null +++ b/news/pan/files/patch-pan::message-send.c @@ -0,0 +1,36 @@ + +$FreeBSD$ + +--- pan/message-send.c 2001/08/22 18:36:41 1.1 ++++ pan/message-send.c 2001/08/22 18:36:50 +@@ -25,7 +25,7 @@ + #include + #include + +-#include ++#include + + #include + +@@ -75,6 +75,7 @@ + gboolean force_new_message_id) + { + gchar * tmp; ++ gchar * s; + const gchar * pch; + debug_enter ("build_nntp_header"); + +@@ -153,9 +154,10 @@ + + /* Add mime header, charset type, encoding type */ + g_string_append (postme, "Mime-Version: 1.0\r\n"); +- pch = nl_langinfo (CODESET); +- if (!is_nonempty_string (pch)) +- pch = "ISO-8859-1"; ++ pch = "ISO-8859-1"; ++ if ((s = setlocale(LC_CTYPE, NULL)) != NULL) ++ if ((s = strchr(s, '.')) != NULL) ++ pch = s + 1; + g_string_sprintfa (postme, "Content-Type: text/plain; charset=%s\r\n", pch); + g_string_append (postme, "Content-Transfer-Encoding: 8bit\r\n"); + diff --git a/news/pan2/files/patch-gmime::gmime-utils.c b/news/pan2/files/patch-gmime::gmime-utils.c new file mode 100644 index 000000000000..95e92d4731f6 --- /dev/null +++ b/news/pan2/files/patch-gmime::gmime-utils.c @@ -0,0 +1,31 @@ + +$FreeBSD$ + +--- gmime/gmime-utils.c 2001/08/22 18:22:18 1.1 ++++ gmime/gmime-utils.c 2001/08/22 18:35:26 +@@ -32,7 +32,7 @@ + #include + #include + #include +-#include ++#include + + #define d(x) + +@@ -128,11 +128,12 @@ + get_codeset (void) + { + const gchar * codeset; ++ gchar *s; + +- codeset = nl_langinfo (CODESET); +- if (!codeset || !*codeset) +- codeset = DEFAULT_CODESET; +- ++ codeset = DEFAULT_CODESET; ++ if ((s = setlocale(LC_CTYPE, NULL)) != NULL) ++ if ((s = strchr(s, '.')) != NULL) ++ codeset = s + 1; + return codeset; + } + diff --git a/news/pan2/files/patch-pan::message-send.c b/news/pan2/files/patch-pan::message-send.c new file mode 100644 index 000000000000..05816edf0e70 --- /dev/null +++ b/news/pan2/files/patch-pan::message-send.c @@ -0,0 +1,36 @@ + +$FreeBSD$ + +--- pan/message-send.c 2001/08/22 18:36:41 1.1 ++++ pan/message-send.c 2001/08/22 18:36:50 +@@ -25,7 +25,7 @@ + #include + #include + +-#include ++#include + + #include + +@@ -75,6 +75,7 @@ + gboolean force_new_message_id) + { + gchar * tmp; ++ gchar * s; + const gchar * pch; + debug_enter ("build_nntp_header"); + +@@ -153,9 +154,10 @@ + + /* Add mime header, charset type, encoding type */ + g_string_append (postme, "Mime-Version: 1.0\r\n"); +- pch = nl_langinfo (CODESET); +- if (!is_nonempty_string (pch)) +- pch = "ISO-8859-1"; ++ pch = "ISO-8859-1"; ++ if ((s = setlocale(LC_CTYPE, NULL)) != NULL) ++ if ((s = strchr(s, '.')) != NULL) ++ pch = s + 1; + g_string_sprintfa (postme, "Content-Type: text/plain; charset=%s\r\n", pch); + g_string_append (postme, "Content-Transfer-Encoding: 8bit\r\n"); + -- cgit v1.2.3