From e8149a2c64f9ffd45c54d1021f1d7cabdc565b03 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Wed, 12 Dec 2007 22:26:17 +0100 Subject: [PATCH] Make /rehash help work again. --- include/hash.h | 4 ---- modules/m_rehash.c | 1 - src/cache.c | 10 +++++++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/hash.h b/include/hash.h index 4a6e72e..dbe1cca 100644 --- a/include/hash.h +++ b/include/hash.h @@ -100,10 +100,6 @@ extern void del_from_resv_hash(const char *name, struct ConfItem *aconf); extern struct ConfItem *hash_find_resv(const char *name); extern void clear_resv_hash(void); -extern void add_to_help_hash(const char *name, struct cachefile *hptr); -extern void clear_help_hash(void); -extern struct cachefile *hash_find_help(const char *name, int flags); - extern void hash_stats(struct Client *); #endif /* INCLUDED_hash_h */ diff --git a/modules/m_rehash.c b/modules/m_rehash.c index e4e66ab..f0da6c1 100644 --- a/modules/m_rehash.c +++ b/modules/m_rehash.c @@ -259,7 +259,6 @@ rehash_help(struct Client *source_p) sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s is forcing re-reading of HELP files", get_oper_name(source_p)); - clear_help_hash(); load_help(); } diff --git a/src/cache.c b/src/cache.c index 3321e64..2ca0bbf 100644 --- a/src/cache.c +++ b/src/cache.c @@ -161,7 +161,8 @@ free_cachefile(struct cachefile *cacheptr) * * inputs - * outputs - - * side effects - contents of help directories are loaded. + * side effects - old help cache deleted + * - contents of help directories are loaded. */ void load_help(void) @@ -170,11 +171,18 @@ load_help(void) struct dirent *ldirent= NULL; char filename[MAXPATHLEN]; struct cachefile *cacheptr; + struct DictionaryIter iter; #if defined(S_ISLNK) && defined(HAVE_LSTAT) struct stat sb; #endif + DICTIONARY_FOREACH(cacheptr, &iter, help_dict) + { + irc_dictionary_delete(help_dict, cacheptr->name); + free_cachefile(cacheptr); + } + /* opers must be done first */ helpfile_dir = opendir(HPATH);