summaryrefslogtreecommitdiff
path: root/regex
diff options
context:
space:
mode:
authorunknown <bar@bar.mysql.r18.ru>2003-01-29 15:08:09 +0400
committerunknown <bar@bar.mysql.r18.ru>2003-01-29 15:08:09 +0400
commit2c2b14f9a2ca44e9e0d5c4eeb16f63305a4d535c (patch)
tree8f169a00789a20a5778e1bd68b7cc7ae9e045e55 /regex
parent231553039f63832fda515edfb80670de178da794 (diff)
downloadmariadb-git-2c2b14f9a2ca44e9e0d5c4eeb16f63305a4d535c.tar.gz
Reorganization to restore generating charset C files from conf files
Diffstat (limited to 'regex')
-rw-r--r--regex/Makefile.am2
-rw-r--r--regex/main.c4
-rw-r--r--regex/regcomp.c2
-rw-r--r--regex/regex.h2
-rw-r--r--regex/reginit.c3
5 files changed, 6 insertions, 7 deletions
diff --git a/regex/Makefile.am b/regex/Makefile.am
index fe72f29b16c..2e23efcbf2a 100644
--- a/regex/Makefile.am
+++ b/regex/Makefile.am
@@ -17,7 +17,7 @@
INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include
noinst_LIBRARIES = libregex.a
-LDADD = libregex.a ../strings/libmystrings.a ../mysys/libmysys.a
+LDADD = libregex.a ../strings/libmystrings.a
noinst_HEADERS = cclass.h cname.h regex2.h utils.h engine.c regex.h
libregex_a_SOURCES = regerror.c regcomp.c regexec.c regfree.c reginit.c
noinst_PROGRAMS = re
diff --git a/regex/main.c b/regex/main.c
index 70d75e6ec50..2597fc58d40 100644
--- a/regex/main.c
+++ b/regex/main.c
@@ -74,7 +74,7 @@ char *argv[];
exit(status);
}
- err = regcomp(&re, argv[optind++], copts, default_charset_info);
+ err = regcomp(&re, argv[optind++], copts, my_charset_latin1);
if (err) {
len = regerror(err, &re, erbuf, sizeof(erbuf));
fprintf(stderr, "error %s, %d/%d `%s'\n",
@@ -226,7 +226,7 @@ int opts; /* may not match f1 */
strcpy(f0copy, f0);
re.re_endp = (opts&REG_PEND) ? f0copy + strlen(f0copy) : NULL;
fixstr(f0copy);
- err = regcomp(&re, f0copy, opts, default_charset_info);
+ err = regcomp(&re, f0copy, opts, my_charset_latin1);
if (err != 0 && (!opt('C', f1) || err != efind(f2))) {
/* unexpected error or wrong error */
len = regerror(err, &re, erbuf, sizeof(erbuf));
diff --git a/regex/regcomp.c b/regex/regcomp.c
index 8a4ebbdfe17..d95a0ddf5d0 100644
--- a/regex/regcomp.c
+++ b/regex/regcomp.c
@@ -117,7 +117,7 @@ CHARSET_INFO *charset;
# define GOODFLAGS(f) ((f)&~REG_DUMP)
#endif
- regex_init(); /* Init cclass if neaded */
+ regex_init(charset); /* Init cclass if neaded */
preg->charset=charset;
cflags = GOODFLAGS(cflags);
if ((cflags&REG_EXTENDED) && (cflags&REG_NOSPEC))
diff --git a/regex/regex.h b/regex/regex.h
index 1602f66d190..e0fb0c77dc9 100644
--- a/regex/regex.h
+++ b/regex/regex.h
@@ -76,7 +76,7 @@ extern void regfree(regex_t *);
/* === reginit.c === */
-extern void regex_init(void); /* Should be called for multithread progs */
+extern void regex_init(CHARSET_INFO *cs); /* Should be called for multithread progs */
extern void regex_end(void); /* If one wants a clean end */
#ifdef __cplusplus
diff --git a/regex/reginit.c b/regex/reginit.c
index fe81f88a342..09ffff37ef0 100644
--- a/regex/reginit.c
+++ b/regex/reginit.c
@@ -7,12 +7,11 @@
static bool regex_inited=0;
-void regex_init()
+void regex_init(CHARSET_INFO *cs)
{
char buff[CCLASS_LAST][256];
int count[CCLASS_LAST];
uint i;
- CHARSET_INFO *cs=default_charset_info;
if (!regex_inited)
{