From: Adam Dickmeiss Date: Fri, 22 May 2015 08:45:28 +0000 (+0200) Subject: Fix incorrect parsing of URLs @:9999/somebase&url=http://some.host YAZ-842 X-Git-Tag: v5.12.2~2 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=4f75f882c49b802a366ef0b8c528c7e688c53b4b;p=yaz-moved-to-github.git Fix incorrect parsing of URLs @:9999/somebase&url=some.host YAZ-842 --- diff --git a/src/comstack.c b/src/comstack.c index 3948cc5..066fafd 100644 --- a/src/comstack.c +++ b/src/comstack.c @@ -55,7 +55,6 @@ const char *cs_strerror(COMSTACK h) void cs_get_host_args(const char *type_and_host, const char **args) { - *args = ""; if (!strncmp(type_and_host, "unix:", 5)) { @@ -67,13 +66,12 @@ void cs_get_host_args(const char *type_and_host, const char **args) } if (*type_and_host) { - const char *cp; - cp = strstr(type_and_host, "://"); + const char *cp = strchr(type_and_host, '/'); if (cp) - cp = cp+3; - else - cp = type_and_host; - cp = strchr(cp, '/'); + { + if (cp > type_and_host && !memcmp(cp - 1, "://", 3)) + cp = strchr(cp + 2, '/'); + } if (cp) *args = cp+1; }