X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fcomstack.c;h=066fafd48d3be517053641411765f716764962b6;hp=3948cc5ad06675b68235bf62ce1e54d7ea16dbac;hb=4f75f882c49b802a366ef0b8c528c7e688c53b4b;hpb=cd86d90b86df0d534f35bc8308ed54105b9cb81c 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; }