scim-skk (0.5.2-5.1) 02_scim_skk_dictionary.cpp

Summary

 src/scim_skk_dictionary.cpp |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

    
download this patch

Patch contents

#! /bin/sh /usr/share/dpatch/dpatch-run
## 02_scim_skk_dictionary.cpp.dpatch by Ikuya Awashiro <ikuya@oooug.jp>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad scim-skk-0.5.2~/src/scim_skk_dictionary.cpp scim-skk-0.5.2/src/scim_skk_dictionary.cpp
--- scim-skk-0.5.2~/src/scim_skk_dictionary.cpp	2005-12-18 22:02:39.000000000 +0900
+++ scim-skk-0.5.2/src/scim_skk_dictionary.cpp	2006-06-18 18:12:15.000000000 +0900
@@ -543,9 +543,11 @@
 UserDict::write (const WideString &key, const CandPair &data)
 {
     list<CandPair> &cl = m_dictdata[key];
-    for (list<CandPair>::iterator it = cl.begin(); it != cl.end(); it++) {
+    for (list<CandPair>::iterator it = cl.begin(); it != cl.end();) {
         if (it->first == data.first) {
-            cl.erase(it);
+            it = cl.erase(it);
+        } else {
+            ++it;
         }
     }
     cl.push_front(data);