aboutsummaryrefslogtreecommitdiff
path: root/gdb/charset.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2009-12-02 11:16:42 +0000
committerTristan Gingold <gingold@adacore.com>2009-12-02 11:16:42 +0000
commit06be6983bb907e61d30fa4c8ec1b434bbfee9e45 (patch)
tree23129d124fabcbd7944749ea57b102ebd187c193 /gdb/charset.c
parent52e6018d9d747d79af4a786993b6697cb0744962 (diff)
downloadgdb-06be6983bb907e61d30fa4c8ec1b434bbfee9e45.zip
gdb-06be6983bb907e61d30fa4c8ec1b434bbfee9e45.tar.gz
gdb-06be6983bb907e61d30fa4c8ec1b434bbfee9e45.tar.bz2
2009-10-23 Tristan Gingold <gingold@adacore.com>
* charset.c (_initialize_charset): Set a default value to auto_host_charset_name if empty.
Diffstat (limited to 'gdb/charset.c')
-rw-r--r--gdb/charset.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/charset.c b/gdb/charset.c
index f5281ed..4bc8894 100644
--- a/gdb/charset.c
+++ b/gdb/charset.c
@@ -818,8 +818,9 @@ _initialize_charset (void)
#ifdef HAVE_LANGINFO_CODESET
auto_host_charset_name = nl_langinfo (CODESET);
/* Solaris will return `646' here -- but the Solaris iconv then
- does not accept this. */
- if (!strcmp (auto_host_charset_name, "646"))
+ does not accept this. Darwin (and maybe FreeBSD) may return "" here,
+ which GNU libiconv doesn't like (infinite loop). */
+ if (!strcmp (auto_host_charset_name, "646") || !*auto_host_charset_name)
auto_host_charset_name = "ASCII";
target_charset_name = auto_host_charset_name;