From 3b0f3294cf66aa79120f6634df459fa81105e764 Mon Sep 17 00:00:00 2001 From: Valeriy Yatsko Date: Wed, 3 Dec 2008 02:59:13 +0300 Subject: [PATCH] Remove irc_basename, replace it with rb_basename from libratbox. --- include/modules.h | 1 - src/ircd_parser.y | 2 +- src/modules.c | 29 ++++------------------------- src/newconf.c | 2 +- 4 files changed, 6 insertions(+), 28 deletions(-) diff --git a/include/modules.h b/include/modules.h index d61061a..8d81215 100644 --- a/include/modules.h +++ b/include/modules.h @@ -116,7 +116,6 @@ extern int unload_one_module(const char *, int); extern int load_one_module(const char *, int); extern int load_a_module(const char *, int, int); extern int findmodule_byname(const char *); -extern char *irc_basename(const char *); extern void modules_init(void); #endif /* INCLUDED_modules_h */ diff --git a/src/ircd_parser.y b/src/ircd_parser.y index 1da9398..90f183a 100644 --- a/src/ircd_parser.y +++ b/src/ircd_parser.y @@ -296,7 +296,7 @@ loadmodule: #ifndef STATIC_MODULES char *m_bn; - m_bn = irc_basename((char *) $2); + m_bn = rb_basename((char *) $2); if (findmodule_byname(m_bn) == -1) load_one_module($2, 0); diff --git a/src/modules.c b/src/modules.c index 0d5cab5..dd977e5 100644 --- a/src/modules.c +++ b/src/modules.c @@ -189,27 +189,6 @@ mod_clear_paths(void) mod_paths.length = 0; } -/* irc_basename - * - * input - - * output - - * side effects - - */ -char * -irc_basename(const char *path) -{ - char *mod_basename = rb_malloc(strlen(path) + 1); - const char *s; - - if(!(s = strrchr(path, '/'))) - s = path; - else - s++; - - (void) strcpy(mod_basename, s); - return mod_basename; -} - /* findmodule_byname * * input - @@ -357,7 +336,7 @@ mo_modload(struct Client *client_p, struct Client *source_p, int parc, const cha return 0; } - m_bn = irc_basename(parv[1]); + m_bn = rb_basename(parv[1]); if(findmodule_byname(m_bn) != -1) { @@ -388,7 +367,7 @@ mo_modunload(struct Client *client_p, struct Client *source_p, int parc, const c return 0; } - m_bn = irc_basename(parv[1]); + m_bn = rb_basename(parv[1]); if((modindex = findmodule_byname(m_bn)) == -1) { @@ -428,7 +407,7 @@ mo_modreload(struct Client *client_p, struct Client *source_p, int parc, const c return 0; } - m_bn = irc_basename(parv[1]); + m_bn = rb_basename(parv[1]); if((modindex = findmodule_byname(m_bn)) == -1) { @@ -793,7 +772,7 @@ load_a_module(const char *path, int warn, int core) int *mapi_version; - mod_basename = irc_basename(path); + mod_basename = rb_basename(path); #ifdef CHARYBDIS_PROFILE tmpptr = dlopen(path, RTLD_NOW | RTLD_LOCAL | RTLD_PROFILE); diff --git a/src/newconf.c b/src/newconf.c index 35a18f8..f2ccf68 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -263,7 +263,7 @@ conf_set_modules_module(void *data) #ifndef STATIC_MODULES char *m_bn; - m_bn = irc_basename((char *) data); + m_bn = rb_basename((char *) data); if(findmodule_byname(m_bn) != -1) return;