From 195cd8844b7a2e3b19e387f4157bb5c5141f0062 Mon Sep 17 00:00:00 2001 From: NotZed Date: Wed, 12 Apr 2000 15:09:58 +0000 Subject: Debug function to dump the whole index to stdout. 2000-04-12 NotZed * find.c (ibex_dump_all): Debug function to dump the whole index to stdout. * words.c (get_ibex_file): Use g_strdup(), not strdup(). 2000-04-11 NotZed * file.c (write_word): Always write out all words we have (even if its 0 ... the file expects it). No longer check for removed files. (store_word): Check for removed files here, and only add to the ordered tree if we have references left to this word. (ibex_write): First insert into the tree, to determine the wordcount to be saved in the output file, and then write that. (ibex_open): Remove some debug. * words.c (ibex_index_buffer): Always set 'unread', if it is a valid pointer (dont rely on caller to initialise it). svn path=/trunk/; revision=2409 --- libibex/words.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libibex/words.c') diff --git a/libibex/words.c b/libibex/words.c index 40e0452403..7642b0a305 100644 --- a/libibex/words.c +++ b/libibex/words.c @@ -159,7 +159,7 @@ get_ibex_file (ibex *ib, char *name) ibf = g_tree_lookup (ib->files, name); if (!ibf) { ibf = g_malloc (sizeof (ibex_file)); - ibf->name = strdup (name); + ibf->name = g_strdup (name); ibf->index = 0; g_tree_insert (ib->files, ibf->name, ibf); ib->dirty = TRUE; @@ -213,6 +213,9 @@ ibex_index_buffer (ibex *ib, char *name, char *buffer, ibex_file *ibf = get_ibex_file (ib, name); int wordsiz, cat; + if (unread) + *unread = 0; + end = buffer + len; wordsiz = 20; word = g_malloc (wordsiz); @@ -261,8 +264,6 @@ ibex_index_buffer (ibex *ib, char *name, char *buffer, p = q; } - if (unread) - *unread = 0; g_free (word); return 0; } -- cgit