summaryrefslogtreecommitdiff
path: root/strings/ctype-ujis.c
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2005-04-06 21:19:20 +0200
committerunknown <serg@serg.mylan>2005-04-06 21:19:20 +0200
commit3960c84f1202cf2e47427df1ca869a054a67f829 (patch)
treed7dfbdbb37dfe91906c38499758105cb11079399 /strings/ctype-ujis.c
parent6f23625d4e70dd2977afcbbd7d12e5f09fe5684a (diff)
parentcde615c9cbff404b6a6c82a1ab7a6bcb8742b88e (diff)
downloadmariadb-git-3960c84f1202cf2e47427df1ca869a054a67f829.tar.gz
manually merged
Gluh's SESSION/GLOBAL for @variables fix in sql_yacc.yy and Bar's well_formed_len() changes in ndb code did not make it and should be re-applied manually BitKeeper/etc/logging_ok: auto-union include/m_ctype.h: Auto merged innobase/btr/btr0pcur.c: Auto merged innobase/include/btr0pcur.h: Auto merged innobase/include/os0file.h: Auto merged innobase/os/os0file.c: Auto merged innobase/row/row0sel.c: Auto merged innobase/srv/srv0start.c: Auto merged mysql-test/r/user_var.result: Auto merged mysql-test/t/user_var.test: Auto merged ndb/include/ndbapi/NdbTransaction.hpp: Auto merged ndb/src/ndbapi/NdbTransaction.cpp: Auto merged ndb/tools/desc.cpp: Auto merged strings/ctype-big5.c: Auto merged strings/ctype-mb.c: Auto merged strings/ctype-simple.c: Auto merged strings/ctype-sjis.c: Auto merged strings/ctype-ucs2.c: Auto merged strings/ctype-ujis.c: Auto merged BitKeeper/deleted/.del-NdbResultSet.cpp~84d192cf3f42600d: ul ndb/include/ndbapi/NdbScanOperation.hpp: ul ndb/src/ndbapi/NdbIndexOperation.cpp: ul ndb/src/ndbapi/NdbOperationDefine.cpp: ul ndb/src/ndbapi/NdbOperationSearch.cpp: ul ndb/src/ndbapi/NdbScanOperation.cpp: ul sql/field.cc: manually merged, because bk messed it up sql/sql_yacc.yy: merged
Diffstat (limited to 'strings/ctype-ujis.c')
-rw-r--r--strings/ctype-ujis.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index deaddcc76f6..7bcf1c83bab 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -8253,11 +8253,12 @@ my_jisx0212_uni_onechar(int code){
static
uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
- const char *beg, const char *end, uint pos)
+ const char *beg, const char *end,
+ uint pos, int *error)
{
const uchar *b= (uchar *) beg;
- for ( ; pos && b < (uchar*) end; pos--, b++)
+ for ( *error= 0 ; pos && b < (uchar*) end; pos--, b++)
{
char *chbeg;
uint ch= *b;
@@ -8267,12 +8268,16 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
chbeg= (char *) b++;
if (b >= (uchar *) end) /* need more bytes */
+ {
+ *error= 1;
return chbeg - beg; /* unexpected EOL */
+ }
if (ch == 0x8E) /* [x8E][xA0-xDF] */
{
if (*b >= 0xA0 && *b <= 0xDF)
continue;
+ *error= 1;
return chbeg - beg; /* invalid sequence */
}
@@ -8280,12 +8285,16 @@ uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
{
ch= *b++;
if (b >= (uchar*) end)
+ {
+ *error= 1;
return chbeg - beg; /* unexpected EOL */
+ }
}
if (ch >= 0xA1 && ch <= 0xFE &&
*b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */
continue;
+ *error= 1;
return chbeg - beg; /* invalid sequence */
}
return b - (uchar *) beg;