X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fsrwutil.c;h=36d88b6938ba72da92c61fd9f04424922d0c02a6;hb=5ba7734cc97eef6688596180b7faf535ee249976;hp=e1421042635cb9e5733b540cbc32d1a6e004956a;hpb=88d3bedf772316f87e1996f655ccf8d1e2589755;p=yaz-moved-to-github.git diff --git a/src/srwutil.c b/src/srwutil.c index e142104..36d88b6 100644 --- a/src/srwutil.c +++ b/src/srwutil.c @@ -13,24 +13,16 @@ #include #include -/** \brief decodes HTTP path (which should hold SRU database) - \param n memory for returned result - \param uri URI path (up to but not including ?) - \param len URI len (up to but not including ?) - \returns ODR allocated database -*/ static char *yaz_decode_sru_dbpath_odr(ODR n, const char *uri, size_t len) { - char *ret = odr_malloc(n, strlen(uri) + 1); - yaz_decode_uri_component(ret, uri, len); - return ret; + return odr_strdupn(n, uri, len); } void yaz_encode_sru_dbpath_buf(char *dst, const char *db) { assert(db); *dst = '/'; - yaz_encode_uri_component(dst+1, db); + strcpy(dst+1, db); } char *yaz_encode_sru_dbpath_odr(ODR out, const char *db)