X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Furi.c;h=987b1217c85484cf491ea9507f10bca686a116d6;hb=7bfdd9cdcbfd12d6690278c9b56a7ac26b2457e9;hp=ed1350a41cc5b9697070cedd96beecc68976a98a;hpb=54dc5b4629da5b10c2f3d4e3bdb7cb70c46669a5;p=yaz-moved-to-github.git diff --git a/src/uri.c b/src/uri.c index ed1350a..987b121 100644 --- a/src/uri.c +++ b/src/uri.c @@ -1,11 +1,14 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2009 Index Data + * Copyright (C) 1995-2011 Index Data * See the file LICENSE for details. */ /** - * \file srwutil.c - * \brief Implements SRW/SRU utilities. + * \file uri.c + * \brief Implements URI utilities. */ +#if HAVE_CONFIG_H +#include +#endif #include #include @@ -25,11 +28,9 @@ static int hex_digit (int ch) static void encode_uri_char(char *dst, char ch) { - if (ch == ' ') - strcpy(dst, "+"); /* mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" */ - else if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || - (ch >= '0' && ch <= '9') || strchr("-_.!~*'(|)", ch)) + if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || + (ch >= '0' && ch <= '9') || strchr("-_.!~*'(|)", ch)) { dst[0] = ch; dst[1] = '\0';