From: handa Date: Mon, 21 Nov 2005 10:29:38 +0000 (+0000) Subject: (parse_nested_list_value): Fix previous change. X-Git-Tag: REL-1-3-0~61 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=a30bcfc4b26827d12ece5dc73c87ee2ba2dcb32c;p=m17n%2Fm17n-lib.git (parse_nested_list_value): Fix previous change. (resolve_command): Fix handling of the return value of get_nested_list. --- diff --git a/src/input.c b/src/input.c index d4ada64..a1a2883 100644 --- a/src/input.c +++ b/src/input.c @@ -334,7 +334,7 @@ parse_nested_list_value (MPlist *plist, MPlist *global, MSymbol key, MPLIST_DO (pl, MPLIST_NEXT (pl)) { MSymbol name; - MPlist *global_def; + MPlist *global_def = NULL; if (! MPLIST_PLIST_P (pl)) continue; @@ -352,12 +352,11 @@ parse_nested_list_value (MPlist *plist, MPlist *global, MSymbol key, continue; global_def = MPLIST_PLIST (MPLIST_NEXT (global_def)); mplist__conc (p, global_def); - global = NULL; } p0 = MPLIST_NEXT (p); if (MPLIST_TAIL_P (p0)) { - if (! global) + if (! global || global_def) continue; global_def = mplist_find_by_value (global, name); if (! global_def) @@ -871,17 +870,23 @@ resolve_command (MSymbol language, MSymbol name, MSymbol command) { MPlist *plist = get_nested_list (language, name, Mnil, M_command); - if (! plist - || ! (plist = mplist_get (plist, command))) - return NULL; - plist = MPLIST_NEXT (plist); + if (! plist) + MERROR (MERROR_IM, NULL); + MPLIST_DO (plist, plist) + { + if (MPLIST_SYMBOL (plist) == command) + break; + plist = MPLIST_NEXT (plist); + } + if (MPLIST_TAIL_P (plist)) + MERROR (MERROR_IM, NULL); + plist = MPLIST_NEXT (plist); if (! MPLIST_PLIST_P (plist)) - return NULL; + MERROR (MERROR_IM, NULL); + plist = MPLIST_NEXT (MPLIST_PLIST (plist)); return plist; } - - /* Load a translation into MAP from PLIST. PLIST has this form: PLIST ::= ( KEYSEQ MAP-ACTION * ) */