From 0285f0bdc0827432057e0803ae69d10fec62031e Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Sat, 27 May 2006 10:37:46 +0000 Subject: [PATCH] shorten name mangling on rsp --- src/plugin.c | 9 ++++++++- src/plugins/rsp.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plugin.c b/src/plugin.c index dec725cc..5fc5c265 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -406,6 +406,8 @@ int plugin_rend_register(char *name, int port, char *iface, char *txt) { PLUGIN_REND_INFO *pri; char *supplied_txt; char *new_name; + char *ver; + char *slash; int name_len; @@ -431,7 +433,12 @@ int plugin_rend_register(char *name, int port, char *iface, char *txt) { memset(new_name,0,name_len); if(conf_get_int("plugins","mangle_rendezvous",1)) { - snprintf(new_name,name_len,"%s (%s)",name,ppi->versionstring); + ver = strdup(ppi->versionstring); + if(strchr(ver,'/')) { + *strchr(ver,'/') = '\0'; + } + snprintf(new_name,name_len,"%s (%s)",name,ver); + free(ver); } else { snprintf(new_name,name_len,"%s",name); } diff --git a/src/plugins/rsp.c b/src/plugins/rsp.c index 5098ee6a..222ff6bb 100644 --- a/src/plugins/rsp.c +++ b/src/plugins/rsp.c @@ -42,7 +42,7 @@ PLUGIN_REND_INFO _pri[] = { PLUGIN_INFO _pi = { PLUGIN_VERSION, /* version */ PLUGIN_OUTPUT, /* type */ - "rsp/" RSP_VERSION, /* server */ + "rsp/" VERSION, /* server */ "/rsp/.*", /* url */ &_pofn, /* output fns */ NULL, /* event fns */