From: Adam Dickmeiss Date: Mon, 12 Sep 2005 09:14:57 +0000 (+0000) Subject: Changed yaz_uri_array to no assume ? in start of URI string. This is X-Git-Tag: YAZ.2.1.10~68 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=5009ac245dc8618eb45f4214b59c472c90869136 Changed yaz_uri_array to no assume ? in start of URI string. This is to fix SRU POST which does not have ? in start of URI string in HTTP body. --- diff --git a/src/srwutil.c b/src/srwutil.c index b2fc44d..e1e7d31 100644 --- a/src/srwutil.c +++ b/src/srwutil.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: srwutil.c,v 1.29 2005-08-22 20:34:21 adam Exp $ + * $Id: srwutil.c,v 1.30 2005-09-12 09:14:57 adam Exp $ */ /** * \file srwutil.c @@ -29,17 +29,18 @@ int yaz_uri_array(const char *path, ODR o, char ***name, char ***val) int no = 2; const char *cp; *name = 0; - if (*path != '?') + if (*path == '?') + path++; + if (!*path) return no; - path++; cp = path; while ((cp = strchr(cp, '&'))) { cp++; no++; } - *name = odr_malloc(o, no * sizeof(char**)); - *val = odr_malloc(o, no * sizeof(char**)); + *name = odr_malloc(o, no * sizeof(char*)); + *val = odr_malloc(o, no * sizeof(char*)); for (no = 0; *path; no++) {