From 5009ac245dc8618eb45f4214b59c472c90869136 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 12 Sep 2005 09:14:57 +0000 Subject: [PATCH] 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. --- src/srwutil.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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++) { -- 1.7.10.4