From: Adam Dickmeiss Date: Thu, 5 Nov 2015 11:50:26 +0000 (+0100) Subject: cs_get_host_args: allow unix:path:args notation X-Git-Tag: v5.14.12~7 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=eec02e3b60802638aa3a105f3037814cf32af3b6;p=yaz-moved-to-github.git cs_get_host_args: allow unix:path:args notation --- diff --git a/src/comstack.c b/src/comstack.c index 9d46728..306ec6d 100644 --- a/src/comstack.c +++ b/src/comstack.c @@ -51,10 +51,14 @@ void cs_get_host_args(const char *type_and_host, const char **args) if (!strncmp(type_and_host, "unix:", 5)) { const char *cp = strchr(type_and_host + 5, ':'); - if (cp) - type_and_host = cp + 1; - else - type_and_host += strlen(type_and_host); /* empty string */ + if (!cp) + return; + type_and_host = cp + 1; + if (!strchr(type_and_host, ':')) + { + *args = type_and_host; /* unix:path:args */ + return; + } } if (*type_and_host) { @@ -65,7 +69,7 @@ void cs_get_host_args(const char *type_and_host, const char **args) cp = strchr(cp + 2, '/'); } if (cp) - *args = cp+1; + *args = cp + 1; } }