]> jfr.im git - solanum.git/blobdiff - ircd/cache.c
Support more human friendly k/d/x-line duration format
[solanum.git] / ircd / cache.c
index b5581f520f3a7bf6c2a113686e24e927bd26da41..ebf6ccae5deb955ec3bedf105981526f51401e3e 100644 (file)
@@ -68,8 +68,8 @@ init_cache(void)
        oper_motd = cache_file(ircd_paths[IRCD_PATH_IRCD_OMOTD], "opers.motd", 0);
        memset(&links_cache_list, 0, sizeof(links_cache_list));
 
-       help_dict_oper = rb_dictionary_create("oper help", strcasecmp);
-       help_dict_user = rb_dictionary_create("user help", strcasecmp);
+       help_dict_oper = rb_dictionary_create("oper help", rb_strcasecmp);
+       help_dict_user = rb_dictionary_create("user help", rb_strcasecmp);
 }
 
 /*
@@ -217,6 +217,10 @@ free_cachefile(struct cachefile *cacheptr)
                        rb_free(line->data);
                        rb_free(line);
                }
+               else
+               {
+                       rb_free_rb_dlink_node(ptr);
+               }
        }
 
        rb_free(cacheptr);
@@ -262,7 +266,7 @@ load_help(void)
        {
                if(ldirent->d_name[0] == '.')
                        continue;
-               snprintf(filename, sizeof(filename), "%s%c%s", ircd_paths[IRCD_PATH_OPERHELP], RB_PATH_SEPARATOR, ldirent->d_name);
+               snprintf(filename, sizeof(filename), "%s/%s", ircd_paths[IRCD_PATH_OPERHELP], ldirent->d_name);
                cacheptr = cache_file(filename, ldirent->d_name, HELP_OPER);
                rb_dictionary_add(help_dict_oper, cacheptr->name, cacheptr);
        }
@@ -277,7 +281,7 @@ load_help(void)
        {
                if(ldirent->d_name[0] == '.')
                        continue;
-               snprintf(filename, sizeof(filename), "%s%c%s", ircd_paths[IRCD_PATH_USERHELP], RB_PATH_SEPARATOR, ldirent->d_name);
+               snprintf(filename, sizeof(filename), "%s/%s", ircd_paths[IRCD_PATH_USERHELP], ldirent->d_name);
 
 #if defined(S_ISLNK) && defined(HAVE_LSTAT)
                if(lstat(filename, &sb) < 0)