diff options
author | portix <portix@gmx.net> | 2010-12-18 00:32:22 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2010-12-18 00:32:22 +0100 |
commit | c8cf2346c427a5d15d197c33835398bf951bd340 (patch) | |
tree | a4d896bff6bcad8048fabd30065cba09e53cad6d /src/util.c | |
parent | a318a01a751301a4bd1b9def81482c9166128d9d (diff) | |
download | dwb-c8cf2346c427a5d15d197c33835398bf951bd340.zip |
allow plugins for specific domains
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -429,16 +429,16 @@ dwb_malloc(size_t size) { void dwb_free(void *p) { if (p) - free(p); + g_free(p); } -/* dwb_util_domain_from_uri (char *uri) return: char* (alloc){{{*/ +/* dwb_util_domain_from_uri (char *uri) return: char* {{{*/ char * -dwb_util_domain_from_uri(char *uri) { +dwb_util_domain_from_uri(const char *uri) { if (!uri) return NULL; - char *uri_p = g_strdup(uri); + char *uri_p = (char*)uri; char *p = NULL; char domain[STRING_LENGTH] = { 0 }; @@ -448,7 +448,7 @@ dwb_util_domain_from_uri(char *uri) { if ( (p = strchr(uri_p, '/')) ) { strncpy(domain, uri_p, p - uri_p); } - char *ret = domain[0] ? g_strdup(domain) : g_strdup(uri_p); + char *ret = domain[0] ? domain : uri_p; return ret; }/*}}}*/ |