diff options
author | NotZed <NotZed@HelixCode.com> | 2000-04-12 23:09:58 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2000-04-12 23:09:58 +0800 |
commit | 195cd8844b7a2e3b19e387f4157bb5c5141f0062 (patch) | |
tree | 7003aa5ece07860765e5149dfed7fae6d8d9c075 /libibex/words.c | |
parent | 73b0317b1fabbb29ae06841c4692a79b80436262 (diff) | |
download | gsoc2013-evolution-195cd8844b7a2e3b19e387f4157bb5c5141f0062.tar.gz gsoc2013-evolution-195cd8844b7a2e3b19e387f4157bb5c5141f0062.tar.zst gsoc2013-evolution-195cd8844b7a2e3b19e387f4157bb5c5141f0062.zip |
Debug function to dump the whole index to stdout.
2000-04-12 NotZed <NotZed@HelixCode.com>
* 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 <NotZed@HelixCode.com>
* 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
Diffstat (limited to 'libibex/words.c')
-rw-r--r-- | libibex/words.c | 7 |
1 files changed, 4 insertions, 3 deletions
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; } |