fix not indicating when no results

This commit is contained in:
Eric House 2020-04-28 15:23:44 -07:00
parent e7c96290ea
commit 8097a6ba0b

View file

@ -611,22 +611,18 @@ XP_S16
di_findStartsWith( DictIter* iter, const Tile* prefix, XP_U16 len ) di_findStartsWith( DictIter* iter, const Tile* prefix, XP_U16 len )
{ {
ASSERT_INITED( iter ); ASSERT_INITED( iter );
XP_S16 offset = findStartsWithTiles( iter, prefix, len ); XP_S16 result = -1;
if ( 0 > offset ) {
/* not found; do nothing */ if ( findStartsWithTiles( iter, prefix, len ) ) {
} else if ( 0 == offset ) { XP_UCHAR buf[32];
if ( !firstWord( iter ) ) { XP_U16 offset = dict_tilesToString( iter->dict, prefix,
offset = -1; len, buf, VSIZE(buf), NULL );
}
} else {
if ( ACCEPT_ITER( iter, iter->nEdges ) || nextWord( iter ) ) { if ( ACCEPT_ITER( iter, iter->nEdges ) || nextWord( iter ) ) {
DictPosition result = figurePosition( iter ); iter->position = figurePosition( iter );
iter->position = result; result = offset;
} else {
offset = -1;
} }
} }
return offset; return result;
} }
void void