From: handa Date: Thu, 29 Mar 2007 12:03:35 +0000 (+0000) Subject: Fix previous changes. X-Git-Tag: FLT-base~96 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=f249825449292e9b978458eac7c6bbe95fe5303a;p=m17n%2Fm17n-lib.git Fix previous changes. --- diff --git a/src/plist.c b/src/plist.c index 324608a..aedf810 100644 --- a/src/plist.c +++ b/src/plist.c @@ -1217,9 +1217,13 @@ mplist_put_func (MPlist *plist, MSymbol key, M17NFunc func) { if (key == Mnil) MERROR (MERROR_PLIST, NULL); - do { - MPLIST_FIND (plist, key); - } while (! MPLIST_TAIL_P (plist) && ! MPLIST_VAL_FUNC_P (plist)); + while (1) + { + MPLIST_FIND (plist, key); + if (MPLIST_TAIL_P (plist) || MPLIST_VAL_FUNC_P (plist)) + break; + plist = MPLIST_NEXT (plist); + }; MPLIST_KEY (plist) = (key); MPLIST_FUNC (plist) = func; @@ -1242,9 +1246,13 @@ mplist_put_func (MPlist *plist, MSymbol key, M17NFunc func) M17NFunc mplist_get_func (MPlist *plist, MSymbol key) { - do { - MPLIST_FIND (plist, key); - } while (! MPLIST_TAIL_P (plist) && ! MPLIST_VAL_FUNC_P (plist)); + while (1) + { + MPLIST_FIND (plist, key); + if (MPLIST_TAIL_P (plist) || MPLIST_VAL_FUNC_P (plist)) + break; + plist = MPLIST_NEXT (plist); + }; return (MPLIST_TAIL_P (plist) ? NULL : MPLIST_FUNC (plist)); }