mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2026-09-19 15:05:19 +00:00
deterministic abbreviation lookup
SCCS-file: zic.c SCCS-SID: 2.9
This commit is contained in:
committed by
Paul Eggert
parent
277918e9e2
commit
737e3687d8
@@ -1120,15 +1120,21 @@ register struct lookup * table;
|
||||
|
||||
if (word == NULL || table == NULL)
|
||||
return NULL;
|
||||
/*
|
||||
** First check for exact match.
|
||||
*/
|
||||
for (lp = table; lp->l_word != NULL; ++lp)
|
||||
if (ciequal(word, lp->l_word))
|
||||
return lp;
|
||||
/*
|
||||
** Now check for unique inexact match.
|
||||
*/
|
||||
foundlp = NULL;
|
||||
for (lp = table; lp->l_word != NULL; ++lp)
|
||||
if (ciequal(word, lp->l_word)) /* "exact" match */
|
||||
return lp;
|
||||
else if (!isabbr(word, lp->l_word))
|
||||
continue;
|
||||
else if (foundlp == NULL)
|
||||
foundlp = lp;
|
||||
else return NULL; /* two inexact matches */
|
||||
if (isabbr(word, lp->l_word))
|
||||
if (foundlp == NULL)
|
||||
foundlp = lp;
|
||||
else return NULL; /* two inexact matches */
|
||||
return foundlp;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user