summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Huang <shawn.p.huang@gmail.com>2010-05-19 12:08:45 +0800
committerPeng Huang <shawn.p.huang@gmail.com>2010-05-19 12:08:45 +0800
commit4eb4f42bfa5b456e6fc176bfde4fb1bc4cbb78bd (patch)
tree8d87e5a4205072fbda7a1a395faf9dd128beee77 /src
parented0651e5dba02d4629811aad85eedb85ad9d1700 (diff)
downloadibus-libpinyin-4eb4f42bfa5b456e6fc176bfde4fb1bc4cbb78bd.tar.gz
ibus-libpinyin-4eb4f42bfa5b456e6fc176bfde4fb1bc4cbb78bd.tar.xz
ibus-libpinyin-4eb4f42bfa5b456e6fc176bfde4fb1bc4cbb78bd.zip
Fix crash when move curso in pinyin "pi'ao"
Diffstat (limited to 'src')
-rw-r--r--src/PinyinParser.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/PinyinParser.cc b/src/PinyinParser.cc
index c489896..3024e15 100644
--- a/src/PinyinParser.cc
+++ b/src/PinyinParser.cc
@@ -127,6 +127,11 @@ PinyinParser::parse (const String &pinyin,
prev_c = 0;
for (; p < end && result.size () < max; ) {
+ if (G_UNLIKELY (*p == '\'')) {
+ prev_c = '\'';
+ p++;
+ continue;
+ }
switch (prev_c) {
case 'r':
case 'n':
@@ -194,11 +199,6 @@ PinyinParser::parse (const String &pinyin,
p += py->len;
prev_c = py->text[py->len - 1];
prev_py = py;
-
- if (G_UNLIKELY (*p == '\'')) {
- prev_c = '\'';
- p++;
- }
}
if (G_UNLIKELY (p == (const gchar *)pinyin))