* Sebastian Hammer, Adam Dickmeiss
*
* $Log: lookgrep.c,v $
- * Revision 1.11 1995-12-06 14:43:02 adam
+ * Revision 1.12 1995-12-11 09:04:48 adam
+ * Bug fix: the lookup/scan/lookgrep didn't handle empty dictionary.
+ *
+ * Revision 1.11 1995/12/06 14:43:02 adam
* New function: dict_delete.
*
* Revision 1.10 1995/11/16 17:00:44 adam
}
}
*max_pos = 0;
- i = dict_grep (dict, 1, mc, Rj, 0, client, userfunc, prefix, dfa,
- max_pos);
+ if (dict->head.last > 1)
+ i = dict_grep (dict, 1, mc, Rj, 0, client, userfunc, prefix,
+ dfa, max_pos);
+ else
+ i = 0;
logf (LOG_DEBUG, "max_pos = %d", *max_pos);
dfa_delete (&dfa);
xfree (Rj);
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: lookup.c,v $
- * Revision 1.5 1995-09-04 09:09:15 adam
+ * Revision 1.6 1995-12-11 09:04:50 adam
+ * Bug fix: the lookup/scan/lookgrep didn't handle empty dictionary.
+ *
+ * Revision 1.5 1995/09/04 09:09:15 adam
* String arg in lookup is const.
*
* Revision 1.4 1994/10/05 12:16:51 adam
char *dict_lookup (Dict dict, const Dict_char *p)
{
- if (dict->head.last == 1)
+ if (dict->head.last <= 1)
return NULL;
return dict_look (dict, p);
}
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: scan.c,v $
- * Revision 1.6 1995-11-20 11:58:04 adam
+ * Revision 1.7 1995-12-11 09:04:50 adam
+ * Bug fix: the lookup/scan/lookgrep didn't handle empty dictionary.
+ *
+ * Revision 1.6 1995/11/20 11:58:04 adam
* Support for YAZ in standard located directories, such as /usr/local/..
*
* Revision 1.5 1995/10/09 16:18:32 adam
int (*f)(Dict_char *name, const char *info, int pos,
void *client))
{
+ if (dict->head.last <= 1)
+ return 0;
return dict_scan_r (dict, 1, 0, str, before, after, client, f);
}