summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2000-08-29 07:14:43 -0600
committerunknown <sasha@mysql.sashanet.com>2000-08-29 07:14:43 -0600
commitf98f62b3b35ae0ff1416f1ed24ccd0ffa89d4122 (patch)
tree8263e214d069f00891f14536c24161e6a27960f5
parent97745efda4a86c019dc94ecb3721b39dee21f490 (diff)
downloadmariadb-git-f98f62b3b35ae0ff1416f1ed24ccd0ffa89d4122.tar.gz
fixed coredump in charset.c - bk messed up, so here is another try to push it
mysys/charset.c: fixed coredump
-rw-r--r--mysys/charset.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/mysys/charset.c b/mysys/charset.c
index b989bf37c7b..82e84715213 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -193,7 +193,9 @@ static my_bool init_available_charsets(myf myflags)
charset_initialized=1;
pthread_mutex_unlock(&THR_LOCK_charset);
}
- return error || !available_charsets[0];
+ if(!available_charsets || !available_charsets[0])
+ error = TRUE;
+ return error;
}
@@ -467,6 +469,7 @@ char * list_charsets(myf want_flags)
DYNAMIC_STRING s;
char *p;
+ (void)init_available_charsets(MYF(0));
init_dynamic_string(&s, NullS, 256, 1024);
if (want_flags & MY_COMPILED_SETS)
@@ -485,16 +488,17 @@ char * list_charsets(myf want_flags)
char buf[FN_REFLEN];
MY_STAT stat;
- for (c = available_charsets; *c; ++c)
- {
- if (charset_in_string((*c)->name, &s))
- continue;
- get_charset_conf_name((*c)->number, buf);
- if (!my_stat(buf, &stat, MYF(0)))
- continue; /* conf file doesn't exist */
- dynstr_append(&s, (*c)->name);
- dynstr_append(&s, " ");
- }
+ if((c=available_charsets))
+ for (; *c; ++c)
+ {
+ if (charset_in_string((*c)->name, &s))
+ continue;
+ get_charset_conf_name((*c)->number, buf);
+ if (!my_stat(buf, &stat, MYF(0)))
+ continue; /* conf file doesn't exist */
+ dynstr_append(&s, (*c)->name);
+ dynstr_append(&s, " ");
+ }
}
if (want_flags & MY_INDEX_SETS)