summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorbar@mysql.com <>2007-03-29 10:32:38 +0500
committerbar@mysql.com <>2007-03-29 10:32:38 +0500
commitd5c66804431f4df36ae32154592ba8a952ed8a8e (patch)
tree3606ee631d829136afda195a23d95dda7f1c7c1b /strings
parent6d290278cc52498305944868c332f1f37003f85c (diff)
downloadmariadb-git-d5c66804431f4df36ae32154592ba8a952ed8a8e.tar.gz
Code layout fix for bug N 27079
Thanks to Gluh for suggestion.
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-uca.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 3aad36f858c..1263882846d 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -6777,25 +6777,24 @@ static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner,
scanner->uca_length= cs->sort_order;
scanner->uca_weight= cs->sort_order_big;
scanner->contractions= cs->contractions;
+ return;
}
- else
- {
- /*
- Sometimes this function is called with
- str=NULL and length=0, which should be
- considered as an empty string.
-
- The above initialization is unsafe for such cases,
- because scanner->send is initialized to (NULL-2), which is 0xFFFFFFFE.
- Then we fall into an endless loop in my_uca_scanner_next_ucs2().
+
+ /*
+ Sometimes this function is called with
+ str=NULL and length=0, which should be
+ considered as an empty string.
+
+ The above initialization is unsafe for such cases,
+ because scanner->send is initialized to (NULL-2), which is 0xFFFFFFFE.
+ Then we fall into an endless loop in my_uca_scanner_next_ucs2().
- Do special initialization for the case when length=0.
- Initialize scanner->sbeg to an address greater than scanner->send.
- Next call of my_uca_scanner_next_ucs2() will correctly return with -1.
- */
- scanner->sbeg= (uchar*) &nochar[1];
- scanner->send= (uchar*) &nochar[0];
- }
+ Do special initialization for the case when length=0.
+ Initialize scanner->sbeg to an address greater than scanner->send.
+ Next call of my_uca_scanner_next_ucs2() will correctly return with -1.
+ */
+ scanner->sbeg= (uchar*) &nochar[1];
+ scanner->send= (uchar*) &nochar[0];
}