summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-03-30 14:25:36 +0800
committerPeng Wu <alexepico@gmail.com>2012-03-30 14:25:36 +0800
commit230ee9362a2908e982ff7ff1766d070249cac5ca (patch)
treeec47d740909cfab220e086a6bd20f075c979a5e6 /src
parent75ad6e979ef5358a614924d9d31ceecaa66f9ae2 (diff)
downloadlibpinyin-230ee9362a2908e982ff7ff1766d070249cac5ca.tar.gz
libpinyin-230ee9362a2908e982ff7ff1766d070249cac5ca.tar.xz
libpinyin-230ee9362a2908e982ff7ff1766d070249cac5ca.zip
fixes post_process2
Diffstat (limited to 'src')
-rw-r--r--src/storage/pinyin_parser2.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp
index df9b589..732598c 100644
--- a/src/storage/pinyin_parser2.cpp
+++ b/src/storage/pinyin_parser2.cpp
@@ -596,13 +596,19 @@ bool FullPinyinParser2::post_process2(pinyin_option_t options,
continue;
const char * onepinyin = str + cur_rest->m_raw_begin;
- size_t len = cur_rest->length();
+ size_t len = strlen(item->m_orig_keys[0]);
+
+ if (cur_rest->length() != len)
+ continue;
if (0 != strncmp(onepinyin, item->m_orig_keys[0], len))
continue;
onepinyin = str + next_rest->m_raw_begin;
- len = next_rest->length();
+ len = strlen(item->m_orig_keys[1]);
+
+ if (next_rest->length() != len)
+ continue;
if (0 == strncmp(onepinyin, item->m_orig_keys[1], len))
break;