Revision: 6670
Author: ek.kato
Date: Wed Aug  4 08:25:53 2010
Log: * scm/look.scm
  - (look-look) : Fix crash when file is not found in
    look-lib-look.
* scm/ct.scm
  - (ct-lib-find-seq)
  - (ct-lib-find-partial-seq)
  - (ct-find-cands-incl-minimal-partial)
    - Ditto.

http://code.google.com/p/uim/source/detail?r=6670

Modified:
 /trunk/scm/ct.scm
 /trunk/scm/look.scm

=======================================
--- /trunk/scm/ct.scm   Sun Jun 13 18:21:49 2010
+++ /trunk/scm/ct.scm   Wed Aug  4 08:25:53 2010
@@ -49,6 +49,7 @@
                     (string-append (sys-pkgdatadir) "/tables/" table)
                     (apply string-append seq))))
       (if (and
+            looked
             (not (null? looked))
             (= (string-contains (car looked) " " 0) 0))
         (list (list seq) (read-from-string (car looked)))
@@ -64,7 +65,9 @@
                     2
                     (string-append (sys-pkgdatadir) "/tables/" table)
                     (apply string-append seq))))
-      (if (not (null? looked))
+      (if (and
+            looked
+            (not (null? looked)))
         (let ((first (car looked))
               (second (if (null? (cdr looked))
                         '()
@@ -120,7 +123,9 @@
                     5000 ;; is it sufficient enough?
                     (string-append (sys-pkgdatadir) "/tables/" table)
                     (apply string-append seq))))
-      (if (not (null? looked))
+      (if (and
+            looked
+            (not (null? looked)))
         (let* ((min-partial-pos
                  (lambda (lst)
                    (let ((maxlen (apply max (map string-length lst))))
=======================================
--- /trunk/scm/look.scm Mon Jun 21 03:53:12 2010
+++ /trunk/scm/look.scm Wed Aug  4 08:25:53 2010
@@ -387,7 +387,7 @@
   (let* ((learned (look-search-learned lc str))
          (looked (look-lib-look #t #t look-candidates-max look-dict str)))
     (look-context-set-dictlen! lc (length learned))
-    (append learned looked)))
+    (append learned (if looked looked '()))))

 (define (look-update lc)
   (let ((str (look-context-left lc)))

Reply via email to