From f249825449292e9b978458eac7c6bbe95fe5303a Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 29 Mar 2007 12:03:35 +0000 Subject: [PATCH] Fix previous changes. --- src/plist.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) 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)); } -- 1.7.10.4