X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Ficu_I18N.c;h=932c1b2d43ad8e9a384d478202d0a945329b2af2;hb=c5408040f72a5a23dc23d6c8d30ee61ea8b6effc;hp=a4aa2445d61781d3bcb01cd4dba2857e08ee7806;hpb=297aa7b45c3bd88aea2799f6810c8c85bc998f56;p=yaz-moved-to-github.git diff --git a/src/icu_I18N.c b/src/icu_I18N.c index a4aa244..932c1b2 100644 --- a/src/icu_I18N.c +++ b/src/icu_I18N.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: icu_I18N.c,v 1.9 2007-10-29 10:22:23 marc Exp $ + * $Id: icu_I18N.c,v 1.10 2007-10-29 13:50:57 marc Exp $ */ #if HAVE_CONFIG_H @@ -1035,6 +1035,7 @@ int icu_chain_step_next_token(struct icu_chain * chain, if (step->previous){ src16 = step->previous->buf16; /* tokens might be killed in previous steps, therefore looping */ + while (step->need_new_token && step->previous->more_tokens && !got_new_token) @@ -1088,8 +1089,10 @@ int icu_chain_step_next_token(struct icu_chain * chain, /* make sure to get new previous token if this one had been used up by recursive call to _same_ step */ - if (!step->more_tokens) + if (!step->more_tokens){ step->more_tokens = icu_chain_step_next_token(chain, step, status); + return step->more_tokens; // avoid one token count too much! + } break; default: @@ -1101,11 +1104,8 @@ int icu_chain_step_next_token(struct icu_chain * chain, return 0; /* if token disappered into thin air, tell caller */ - if (!step->buf16->utf16_len) - return 0; - - if (U_FAILURE(*status)) - return 0; + /* if (!step->buf16->utf16_len && !step->more_tokens) */ + /* return 0; */ return 1; } @@ -1173,7 +1173,7 @@ int icu_chain_next_token(struct icu_chain * chain, while(!got_token && chain->steps && chain->steps->more_tokens) got_token = icu_chain_step_next_token(chain, chain->steps, status); - + if (got_token){ chain->token_count++;