- while ((p = read_element (p, st)));
- MPLIST_SET_ADVANCE (plist, Mplist, pl);
+ p = read_element (p, st, NULL);
+ if (keys && p && MPLIST_SYMBOL_P (pl))
+ {
+ MPlist *p0 = keys;
+ MPLIST_FIND (p0, MPLIST_SYMBOL (pl));
+ if (! MPLIST_TAIL_P (p0) && ! MPLIST_VAL (p0))
+ {
+ M17N_OBJECT_UNREF (pl);
+ return NULL;
+ }
+ while ((p = read_element (p, st, NULL)));
+ if (! MPLIST_TAIL_P (p0))
+ MPLIST_SET_ADVANCE (plist, Mplist, pl);
+ else
+ M17N_OBJECT_UNREF (pl);
+ }
+ else
+ {
+ if (p)
+ while ((p = read_element (p, st, NULL)));
+ MPLIST_SET_ADVANCE (plist, Mplist, pl);
+ }